Skip to content

Fix android hold action#2011

Merged
balloob merged 1 commit intodevfrom
fix-android-hold-action
Nov 11, 2018
Merged

Fix android hold action#2011
balloob merged 1 commit intodevfrom
fix-android-hold-action

Conversation

@thomasloven
Copy link
Copy Markdown
Contributor

This could possibly fix #1950.

I don't have an android device with chrome, so I can't test, but this prevents the context menu from popping up when emulating a touch device in chrome on my computer - which I think was the problem.

It would be great if someone could test this before merging.
@zsarnett ?

@zsarnett
Copy link
Copy Markdown
Contributor

zsarnett commented Nov 7, 2018

Will test as soon as I can

@zsarnett
Copy link
Copy Markdown
Contributor

zsarnett commented Nov 7, 2018

@thomasloven So it works when I inspect it in chrome debugger and click using my mouse.

Example1

But pressing the button on my phone using my finger I never get the purple circle and no matter how long I hold it never does the hold_action.

Example2

Also, not sure if this was an issue before but now when I try to scroll on the button it acts like I press the button (scroll on the button means I touch the button and pull up or down) this doesnt move the screen at all and only toggles and hold action doesnt work

Edit: Just reverted the changes and scrolling on the button does work with out this change

@thomasloven
Copy link
Copy Markdown
Contributor Author

Well... back to the drawing board...

@thomasloven thomasloven changed the title Fix android hold action WIP Fix android hold action Nov 7, 2018
@thomasloven
Copy link
Copy Markdown
Contributor Author

thomasloven commented Nov 8, 2018

Next attempt. Could you go here, click and long-press each of the squares and then tell me what happens?

@zsarnett
Copy link
Copy Markdown
Contributor

zsarnett commented Nov 8, 2018

Holding

REsults

Tap

Tap

@thomasloven thomasloven force-pushed the fix-android-hold-action branch from e758e7a to 299d394 Compare November 8, 2018 17:18
@thomasloven thomasloven changed the title WIP Fix android hold action Fix android hold action Nov 8, 2018
@zsarnett
Copy link
Copy Markdown
Contributor

zsarnett commented Nov 8, 2018

I don't know enough about this code and touch events to be able to review the code to say its "good" for merging. But It does work. Requesting @balloob to review

@zsarnett zsarnett requested a review from balloob November 8, 2018 17:29
@thomasloven thomasloven force-pushed the fix-android-hold-action branch from 299d394 to 3223451 Compare November 8, 2018 21:19
@zsarnett
Copy link
Copy Markdown
Contributor

zsarnett commented Nov 8, 2018

Tested: Hold and Tap Action work. Scrolling also works

@thomasloven thomasloven force-pushed the fix-android-hold-action branch from 3223451 to c06ac58 Compare November 8, 2018 23:48
@thomasloven
Copy link
Copy Markdown
Contributor Author

The problem, for reference, was that chrome for android opens a context menu when pressing and holding for about half a second. When the context menu is opened, the touch event is interrupted, so no touchend is sent. Instead a touchcancel is sent, and for some reason this happens even if there is no context menu...

@thomasloven thomasloven force-pushed the fix-android-hold-action branch from c06ac58 to cfc4202 Compare November 9, 2018 09:39
@thomasloven thomasloven force-pushed the fix-android-hold-action branch from cfc4202 to 19ca42d Compare November 9, 2018 13:05
@balloob balloob merged commit a4c9bb4 into dev Nov 11, 2018
@balloob balloob deleted the fix-android-hold-action branch November 11, 2018 20:27
@ghost ghost removed the in progress label Nov 11, 2018
@casey-hill
Copy link
Copy Markdown

I'm not sure if this thread is still going on but the problem is interesting. I was able to use this thread to solve my own problem. While the fix is in place for the phones, a Windows 10 devices running Edge or Chrome isn't working using the toggle action. No idea how to troubleshoot something like this but my phone works fine … yet the computer(s) do not.

@thomasloven
Copy link
Copy Markdown
Contributor Author

Avoid discussion in closed PRs.
If it's still not working for you with the lastest version of Home Assistant, please open a new issue.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Dec 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lovelace long-press does not work on Android/Chrome

5 participants