home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.58k stars 306 forks source link

Hold action unreliable #1881

Open michalk-k opened 3 years ago

michalk-k commented 3 years ago

Model Name: iPhone X Software Version: iOS15 App version: 2021.8 (2021.216)

Home Assistant Core Version 2021.9.7

Describe the bug This issue is not related to this particular iOS nor app nor core versions. It was appearing half year ago, it appears today. Also not sure it is iOS or Polymer related. I've read other's experience that on Android hold action works as expected. I can confirm that on PC (win/linux) it works as expected.

On iOS however attempt to execute hold action is prone to fail. From what I can observe, it seems that it's very sensitive to side-movements of a finger. To the extent that it require super-focusing for a time interval needed to hold action to execute. Otherwise the process is being interrupted. I can succeed for 1 out of 5 attempts only. Obviously hold feature in iOS itself (including other apps) works as expected

To Reproduce N/A

Expected behavior More reliable hold event recognition

Screenshots Here is short video with demonstration https://youtu.be/e-s3B_rzek8 Additional context N/A

zacwest commented 3 years ago

I see, the magnification loupe is triggering on the long press there. It may be possible to disable all text selection in the WebView which would prevent this from happening.

You can try this hypothesis out in CSS via user-select: none; if you can override it.

michalk-k commented 3 years ago

I've added it to my theme. Chrome DevTools shows every element to inherit this property

But it doesn't change the behaviour in iOS.

zacwest commented 3 years ago

Does your experience in iOS 15 act the same as you saw in iOS 14? There appears to be a bug in iOS 15 where it ignores the user-select property: https://bugs.webkit.org/show_bug.cgi?id=231161

michalk-k commented 3 years ago

yes, the hold action was acting the same in previous iOS versions. I'm not able however to check css style in other version of ios than current one

deluxestyle commented 2 years ago

Having the same issue Hold action is not always reacting as it should

Nickno95 commented 2 years ago

Suggestion to check for hold within the boundary of the object rather than the specific point of initial touch/click? Not sure about how to implement, but if it's using touch events, maybe check if within button on touchend?

Edit: looks like the user select bug fix has already been done but has not been pushed into an iOS update or beta yet. So waiting for Apple to push change would probably be easiest solution.

bgoncal commented 7 months ago

Is this still an issue with latest versions of app and core? Feel free to reopen if needed

michalk-k commented 7 months ago

@bgoncal You closed the issue so quickly... The reported problem still persist.

bgoncal commented 7 months ago

@bgoncal You closed the issue so quickly... The reported problem still persist.

That's why I mentioned "feel free to reopen", I was doing some clean up in old issues.

Meanwhile, is this behavior also happening when accessing HA over iOS Safari?

michalk-k commented 6 months ago

kind of... similar. But I think I know where the problem is coming from.

It,s vertical scrolling of main part of the ui causes interrupting of any hold action.

I found it recently in vacuum card which provides option to zoom map by two fingers. It's being interrupted as hell. I noticed it happens every-time when the UI page scrolls (even if I still hold the screen with two fingers)

The same happens to reported hold action. Simply if your finger moves horizontally a bit, it interrupts initial phase of hold action

I'm not sure it's framework or os specific and it if you can done anything to improve that. I've checked a few apps which implement hold action and vertically scrollable viewports at the same time (ie google docs), and seems they react on hold better. it's like they disable vertical scroll earlier then wait for longpress time condition a bit more. Our app doesn't lock vertical scroll at all

with regards

bgoncal commented 5 months ago

kind of... similar. But I think I know where the problem is coming from.

It,s vertical scrolling of main part of the ui causes interrupting of any hold action.

I found it recently in vacuum card which provides option to zoom map by two fingers. It's being interrupted as hell. I noticed it happens every-time when the UI page scrolls (even if I still hold the screen with two fingers)

The same happens to reported hold action. Simply if your finger moves horizontally a bit, it interrupts initial phase of hold action

I'm not sure it's framework or os specific and it if you can done anything to improve that. I've checked a few apps which implement hold action and vertically scrollable viewports at the same time (ie google docs), and seems they react on hold better. it's like they disable vertical scroll earlier then wait for longpress time condition a bit more. Our app doesn't lock vertical scroll at all

with regards

Do you experience the same issue if you use it through iOS Safari? (not from within the app)

michalk-k commented 5 months ago

Yes. "kind of... similar" was actually the answer to this question. Any vertical movement, started after hold initialization, cancels this action. Seems like the vertical scroll has precedence over the hold action.

bgoncal commented 5 months ago

Sorry, I missed your answer, in this case I think you will have more luck bringing this issue to fronend repo, because they are the ones that can fix for browser + apps all at once, fixing in the app would be an workaround that could potentially break again since frontend would be aware of it.