Fixed position element with touch-action: none leads to inaccurate touch hit testing.
Reported by
calebdot...@gmail.com,
May 31 2018
|
|||||||||||||||||
Issue descriptionSteps to reproduce the problem: 1. Navigate to https://codepen.io/MillerTime/debug/GdwPRz 2. Make a swipe gesture on white sidebar. 3. Swipe up on blue background to scroll URL bar out of view (and increase visible viewport). What is the expected behavior? 1. The white sidebar should extend vertically to fill the space where the URL bar used to be, effectively covering the full viewport height. 2. The buttons in the sidebar should react normally to touch input. What went wrong? 1. The white sidebar does not extend, leaving a gap with the blue background visible where the URL bar used to be. 2. Touch hit testing on the buttons is off by the height of the URL bar. E.g. pressing "Button 2" visually affects "Button 3" instead. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 66.0.3359.158 Channel: stable OS Version: 8.0.0 Flash Version: The key to triggering this bug is to have an element with the following CSS: position: fixed; top: 0; bottom: 0; touch-action: none; You can fork the CodePen here for experimentation: https://codepen.io/MillerTime/pen/GdwPRz I'm pretty sure this worked before as I would have noticed touches not targeting the correct element. Not sure which version of Chrome it last worked, though. The CodePen demo works fine on Firefox for Android. You can also trigger the reverse direction of what I described went wrong: 1. Slide the scrollbar out of view by swiping up on the blue background (must wait a few seconds after page load before URL bar can be hidden). 2. Make a swipe gesture on the white sidebar. 3. Pull the URL bar back down with a swipe down on the blue background. Now the sidebar fails to shrink, and pressing "Button 3" visually affects "Button 2".
,
May 31 2018
,
May 31 2018
I've encountered this issue on a Samsung S9+ running Android 8.0.0, a OnePlus 3T running Android 8.0.0, and a Motorola phone running Android 7.x (not sure on the details of the Motorola device). A screencast of the issue is attached. In the video, I take the following steps using the same CodePen demo linked above: - reload page - scroll up and down on the blue background a few times to show the expected behavior - make a swipe on the white fixed position sidebar, this initiates the bugged state - demonstrate that scrolling down the page and hiding the omnibox no longer affects the sidebar - demonstrate the incorrect hit testing on the buttons (and how it only takes place when omnibox is hidden) - reload the page again - scroll down to hide omnibox; observe sidebar expanding - make a swipe gesture on sidebar to initiate bug, this time in the expanded state - scroll page up to reveal omnibox, observing how the omnibox now covers up the sidebar - demonstrate the incorrect hit testing on buttons again, but in the reverse direction Let me know if there's anything else I can help with. Thanks!
,
May 31 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 1 2018
Unable to test the issue on the mentioned devices above, as those are not available with us. @Reporter: Could you please update Chrome to latest version #67.0.3396.68 and check if you still face the issue? Thanks!!
,
Jun 6 2018
Co-signing on a similiar issue ... i'm on a Samsung S9+ with Chrome 67.0.3396.68. I noticed the issue on a site I was developing which has a navigation bar "pinned" to the bottom of the viewport using CSS: position: fixed bottom: 0 ... which you scroll down and Chrome becomes "chrome-less" (aka the address url bar disappears), it seems to trigger some funky behavior. On my site, the bottom positioned navbar will disappear occasionally or even worse it will stay visible but will not detect touch. (insteads it seems the touch event happens behind the floating navbar ... triggering a click on the dom element that's hidden behind the nav even though the zIndex for the navbar is higher) You can actually reproduce this by going to instagram.com in browser, scrolling down on your newsfeed a bit to trigger the chrome-less browser state (hidden address bar) and then trying to click on one of the navigation buttons in the bottom position instagram ui bar that's also pinned to the bottom of the browser.
,
Jun 6 2018
Hi Sandeep, I have all versions of Chrome up-to-date as far as the Play Store is concerned. I'm currently running: Stable: 66.0.3359.158 Beta: 67.0.3396.68 Dev: 68.0.3440.14 Canary: 69.0.3451.0 The issue I've described is present on all of the above versions of Chrome, on my OnePlus 3T. I also confirmed the issue is present on the Samsung S9+ running Chrome 67.0.3396.68. Is there any chance this problem is resolved with Android 8.1.0, as you mentioned you are using? I'd be surprised if that is the case, but who knows. All of the devices I'm testing with are running Android 8.0.0 or lower. Also, I assume you've followed all the steps I listed with the video, but I just want to reiterate that the step of doing a *swipe* gesture on the white sidebar is crucial to reproduction. A simple tap on the sidebar won't initiate the bugged behavior.
,
Jun 6 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 16 2018
,
Jun 16 2018
Confirmed in 67.0.3396.87 and 68.0.3440.23 but doesn't repro for me in 69.0.3462.0. calebdotmiller@, can you please check the latest canary?
,
Jun 16 2018
Can confirm this is still an issue on 69.0.3462.0. The same procedure on the CodePen demo still triggers the bug for me.
,
Jun 18 2018
You're right, it took a bit more work but seems to repro there as well. thanks, will investigate.
,
Jun 18 2018
Seems like it does not require touch:none to trigger. Using the attached file, scroll really really fast to the bottom (within about 0.2 seconds). If the red sidebar does not stay attached to the top of screen, the bugged state is triggered. In the bugged state, clicks land about one omnibox away from where they should be (i.e. clicking on 6 presses 8) The opposite can be triggered by scrolling up really fast.
,
Jun 18 2018
Also, if it helps: once Chrome gets into the bugged state, rotating the phone to try to re-layout the page would not get it out of the bugged state. The position:fixed, top:0, bottom:0 element is still one omnibox away from the top of screen, and clicks are still landing one omnibox below where they should be.
,
Jun 18 2018
@mings Running your HTML file on the current Stable & Canary builds, and scrolling violently, I can't reproduce the same issue. I can get the omnibox to overlap a few of the fixed list items on Stable, but upon tapping, the correct element is still targeted. What version of Chrome are you using? Also, in the CodePen demo I've linked, if I comment out the `touch-action: none` line, the issue no longer manifests. The only way I've personally been able to repro this is when `touch-action: none` is used. It sounds like you might be onto something, but unfortunately I can't see it! I do like your use of an "omnibox unit", though :)
,
Jun 18 2018
@calebdot 67.0.3396.87 on Android 6.0.1 on OPPO A57. Yes it seems to be easier to reproduce with touch-action:none, but I managed to do it without.
,
Jun 18 2018
I think I managed to consistently trigger the bug on 67.0.3396.87 on Android 6.0.1. Using the attached scrollbug.html from Comment 13: 1) Fling upwards (means scroll downwards) at a speed which causes omnibox to hide updwards. 2) While page is scrolling downwards under inertia, fling downwards again. The key is 2 flings to trigger the internal confusion.
,
Jun 19 2018
@mings Hey, that does the trick. I think you meant "fling *upwards* again", but yes if I perform two swipe up gestures in quick succession, where the second swipe up happens mid-scroll while the document is coasting on its own, the same bug occurs. This same trick does indeed work on my CodePen, even with `touch-action: none` commented out. It is harder to perform, but it's consistent once you figure it out. Nice find!! This seems to prove that `touch-action: none` isn't a requirement. The title of this issue may be misleading. I wonder if performing a swipe gesture on an element with `touch-action: none` triggers the same internal state as when the page is scrolling from inertia, but without actually scrolling. So then it gets "stuck" in that state and doesn't reset. Just a wild guess, but that would explain why `touch-action: none` and a swipe makes it easier to repro, because there's no longer a strict timing requirement.
,
Jun 20 2018
I wonder if the issue described by @webworld is the same one @mings demonstrated, since `touch-action: none` didn't seem to play a part. I can reproduce the issue on Instagram as mentioned, by scrolling quickly as described by @mings.
,
Jun 21 2018
I think we've encountered a slight variation of this issue (or mings.. must refer to this when stating 'The opposite can be triggered by scrolling up really fast'). The result is also an offset in the place where a push/click is registered compared to where it is shown on an android device. Symptoms: In the example given in Comment 13: we noticed that the red area would show up underneath the omnibox (approximately until line 5). When trying to click on link 8 it would register the click as if we where clicking line 2 or so. We've also create a small example to reproduce the issue but we have only been able to observe the behavior as primary described: http://embed.plnkr.co/KYXVjVmTrT0eFqedcFxT/
,
Jun 21 2018
Issue 854408 has been merged into this issue.
,
Jun 21 2018
Coming from Issue 854408 I see many other people here with the same issue. I believe I found a workaround for the issue but would love to get more feedback from people having the same problem so that I can think of pushing this to production (until it's fixed on Chromium). What I did was replace the offending element with itself (forcing a browser re-layout) on the 'touchend' event. This is perfect because the problem only exists on mobile and 'touchend' does not exist on desktop versions. Working workaround (hopefully): https://codepen.io/rfgamaral/pen/WyzBay
,
Jun 21 2018
@mas: After copying your code from codepen i can't seem to see the fix after triggering the bug. This workaround would be quite surprising to me if it worked, as the website I was debugging would have fixed itself due to the way it works. (the fixed position element is a modal overlay with dynamic content, showing and hiding that model re-creates the DOM)
,
Jun 21 2018
Are you saying the workaround didn't work for you? > (the fixed position element is a modal overlay with dynamic content, showing and hiding that model re-creates the DOM) Depends, how are you showing/hiding? Are you really adding/removing elements from the DOM or just switching the display property? Those are two different things. The latter might not trigger whatever my workaround triggers in Chrome to fix the issue. Don't know, just thinking out loud. So far, on my end, I wasn't able to replicate the issue anymore after applying the workaround. i might have to test this a little bit further maybe... That's why I'd love it if more people could try this to reach a conclusion if this is a viable workaround or not.
,
Jun 21 2018
QA team: a bisect would be very helpful in getting a fix here. The repro in the report worked well for me.
,
Jun 22 2018
@mas: it does not seem to work for me. Unless I misunderstood React badly, my production code will destroy and re-create the DOM for the fixed-position element. Using your codepen on 67.0.3396.87: 1) scroll downwards using two flings 2) I need to touch one omnibox above the button to change its color
,
Jun 22 2018
I want to narrow the triggering conditions a bit more: This bug seems to require bottom:0px to trigger. top:0px elements seem to be immune to this. This is tested with the fling downwards and fling upwards variants of the bug.
,
Jun 22 2018
I'm seeing this bug with any fixed element, regardless of bottom or top positions.
,
Jun 22 2018
This bug also seems to affect the browser's idea of height:100% for position:fixed elements. 1) Use bokan's example https://bokand.github.io/demo/urlbarsize.html 2) Fling up twice as described Observations: 1) "percentage-based position:fixed" will no longer stretch to fill the viewport height when omnibox is shown 2) OnResize events stopped getting triggered.
,
Jun 22 2018
Recently we've seen something similar on iOS. It boiled down to not properly passing the visual viewport (if I read correctly). See webkit bug report: https://bugs.webkit.org/show_bug.cgi?id=176896
,
Jun 22 2018
,
Jun 22 2018
This bug affects Discourse, check here for the report: https://meta.discourse.org/t/experiencing-a-lot-of-issues-replying-on-android/84086/31?u=falco I can repro this on Instagram too, which has a position fixed div in the bottom.
,
Jun 23 2018
Issue 855694 has been merged into this issue.
,
Jun 23 2018
Ok - I have a fix written up, I just need to add tests. Should be able to land it on Monday.
,
Jun 27 2018
Seems like fixed in canary
,
Jun 27 2018
I can still repro - my fix hasn't landed yet.
,
Jul 4
,
Jul 5
I can see this bug on a site i´m developing with a Floating Action Button (position: fixed; bottom: 15px; right: 15px). Chrome 67.0.3396.87 Android 8.0.0
,
Jul 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4b32e5d123858b92e02524bff9a3ecc16ccd692e commit 4b32e5d123858b92e02524bff9a3ecc16ccd692e Author: David Bokan <bokan@chromium.org> Date: Mon Jul 09 02:11:59 2018 Stop counting flings in Android gesture listener This patch changes the Android GestureListenerManagerImpl class to track ongoing flings as a binary on/off switch, rather than counting outstanding GestureFlingStarts. This was previously an integer count as the flings would be processed in the renderer so the start/end were asynchronous. Now that fling has been moved into the browser process, we can be immediately sure there's at most one fling running at any given time. The attached bug was reproducing because fling boosting GestureFlingStart events would ACK as consumed [1] to the GestureListenerManagerImpl class but they wouldn't cause a GestureFlingEnd. This meant the class would accumulate outstanding gesture flings, preventing a resize from the URL bar [2] because the class believed we were still in a scroll. [1] FlingControllerFilterEvent in InputRouterImpl::SendGestureEvent [2] GestureStateListener:onScrollingStateChanged in Tab.java Bug: 848122 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I69508c3eae88bd528236d7f21cb75136d5f8cc2d Reviewed-on: https://chromium-review.googlesource.com/1112776 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#573200} [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/android_webview/java/src/org/chromium/android_webview/AwContents.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTestUtils.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/browser/android/content_ui_event_handler.cc [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/browser/renderer_host/render_widget_host_view_android.cc [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/public/android/java/src/org/chromium/content/browser/ContentUiEventHandler.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/public/android/java/src/org/chromium/content/browser/GestureListenerManagerImpl.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/public/android/java/src/org/chromium/content/browser/JoystickHandler.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/android/event_forwarder.cc [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/android/event_forwarder.h [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/android/java/src/org/chromium/ui/base/EventForwarder.java [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/events/android/gesture_event_android.cc [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/events/android/gesture_event_android.h [modify] https://crrev.com/4b32e5d123858b92e02524bff9a3ecc16ccd692e/ui/events/blink/blink_event_util.cc
,
Jul 10
I've confirmed the fix in Canary. Requesting merge to M68.
,
Jul 10
This bug requires manual review: We are only 13 days from stable. Please contact the milestone owner if you have questions. Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 10
Thanks @bokan, I can also confirm this is resolved in Canary.
,
Jul 10
So great to hear @bokan! https://media.giphy.com/media/1PMVNNKVIL8Ig/giphy.gif Thanks for getting to the bottom of the issue :)
,
Jul 10
Issue 856716 has been merged into this issue.
,
Jul 10
I'll be OOO so handing off the merge and any followup to sahel@. Re: merge - the patch should be safe to merge. It looks larger than it is because most of the changes are tests and renaming. The functional change is fairly minor. I believe the risk is justified as this is a fairly nasty bug and commonly hit (see # of stars).
,
Jul 10
I am not comfortable merging this change into M68 at this time. It looks very risky and that's a lot of code change. Can this wait for M69? What is the rationale behind merging it into M68?
,
Jul 10
>I am not comfortable merging this change into M68 at this time. It looks very risky and that's a lot of code change. I have reviewed the cl and can confirm that as bokan mentioned, the functional change is minor. GestureListenerManagerImpl.java has the main changes and the rest of the changes are tests and/or necessary plumbing for prevent_boosting. >Can this wait for M69? What is the rationale behind merging it into M68? I cannot comment on the necessity of the merge, since bokan@ is OOO, maybe pnangunoori@ or other people cc'ed have a better idea.
,
Jul 10
If it helps with a merge decision I am the reporter of Issue 850773 , the fix for this bug should fix mine. I have been seeing this issue daily in Chrome Dev since before June 7 when I reported it.
,
Jul 10
Just want to highlight that this bug breaks: - Twitter - Instagram - Discourse and every site that uses infinite scroll and has a fixed div. I think it's reasonable to evaluate fast tracking this into stable sooner.
,
Jul 10
Agreed with the others here, the faster this gets out the better. This bug plagues our mobile sites main navigation as well as modals and other fixed elements. It completely cripples the UI and therefore diminishes the UX. Please do what you can to fast track this.
,
Jul 11
If it helps, I'd also like to emphasize that a a fast release of this fix seems necessary. Our application is served to approximately half a million users that now have a flawed user experience. We've had to advice our users to temporarily use other browsers or to try to workaround by scrolling outside the modal panels that are affected. All in all, the impact is pretty high for something that 'should just work'.
,
Jul 11
Thanks all for your input! Really appreciated! Let's get this fix into M68 which is going to be released soon.
,
Jul 12
Issue 854088 has been merged into this issue.
,
Jul 12
The fix is merged to M68: https://chromium-review.googlesource.com/c/chromium/src/+/1134192
,
Jul 12
,
Jul 12
I have the same issue on my Android in a very similar scenario of another major project, the tap area and the rendered area of a Div button go out of sync after some URL bar scrolling, I hope this gets fixed quickly, it gives a real bad UX , thank you very much
,
Jul 13
Issue 862130 has been merged into this issue.
,
Jul 16
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible! If all merges have been completed, please remove any remaining Merge-Approved labels from this issue. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 16
,
Jul 19
Issue 863754 has been merged into this issue.
,
Jul 26
This issue also affects Airbnb.
,
Jul 26
Is there a confirmed workaround for this bug?
,
Jul 26
A new version of Chrome (v68) which contains the fix has been released yesterday. But if you can't use that (yet) we've experienced that you can force a rerender/reset of the touch offset by scrolling somewhere outside of the element that is on top.
,
Jul 28
Were you able to make this happen with code without affecting the UX?
,
Jul 30
Hello, I have been able to reproduce a very similar bug. Rendering is broken when fixed element (with top:0, bottom:0) is added to DOM when address bar is animating. Timing is a bit tricky to get, but see attached recording of what happens. Also the html that I used to reproduce this bug. For real world implications this will break adding modals, meaning that user experience is very poor, when some backdrop is completely off. Because this particular bug was reported as fixed I tried and succeeded to reproduce this in canary 70.0.3503. If Im correct at reading release notes, this bug should have been fixed in previous version, meaning this is corner case.
,
Jul 30
l.kadikinaite@ what you described in comment #66 is a different issue, please file a new bug with steps to reproduce it.
,
Aug 3
|
|||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||
Comment 1 by sandeepkumars@chromium.org
, May 31 2018Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback