Trying to scroll up reloads the page on kucharkaprodceru.cz with pull-to-refresh enabled
Categories
(Web Compatibility :: Site Reports, defect, P2)
Tracking
(Not tracked)
People
(Reporter: ksenia, Unassigned)
References
()
Details
(Keywords: webcompat:sitepatch-applied)
Steps to reproduce
- With pull-to-refresh enabled visit https://www.kucharkaprodceru.cz/snehova-rolada/#more-13825 and scroll down.
- Scroll up.
Expected behavior
Scrolling up should work as expected
Actual behavior
Pull-to-refresh is triggered and page reloads
Device information
- Firefox version: 117.0a1
- Android device model: Pixel 4a
- Android OS version: 13
Initially reported in https://github.com/webcompat/web-bugs/issues/123452
Comment 1•1 year ago
|
||
Confirmed.
This one looks like an issue on the APZ side: the InputResult value we're computing is Unhandled, which is incorrect.
Comment 2•1 year ago
|
||
This site is doing something fairly unusual:
- The <body> element is overflow-y:hidden, so as far as APZ is concerned the page is not scrollable (this is why the InputResult value is not Handled).
- The page listens for touch events and performs scrolling in the event listener (this is why the page appears scrollable in spite of being overflow-y:hidden.
- However, the event listener does not preventDefault() the touch events (this is why the InputResult value is not HandledByContent).
- It gets away with that because the page being overflow-y:hidden means that the browser default behaviour for the touch events is a no-op.
It's not clear what we can do about this in APZ. A passive touch event listener could just be observing touch events and not scrolling the page, so we don't want to return HandledByContent for pages with passive touch event listeners in general.
Comment 3•1 year ago
|
||
Interestingly, in Chrome the page does not appear to be overflow-y:hidden, and accordingly pull-to-refresh behaves as expected.
Comment 4•1 year ago
•
|
||
Confirmed via devtools that the page is not overflow-y:hidden in Chrome, meaning the site serves different content (or content with script that sets up different styles) to Chrome vs. Firefox.
After further investigation I have discovered the following:
- The overflow-y:hidden style is set from script that appears to be a minified version of jquery.nicescroll, a jquery plugin whose purpose seems to be to customize the appearance of scrollbars and perform other scrolling customizations
- The version of jquery.nicescroll the site appears to be using is 3.4.0, which is 10 years old
- The logic to set overflow-y:hidden is in a branch that's conditioned on a variable
cap.cantouch
which is true in Chrome but false in Firefox (note: I'm linking to the corresponding non-minified source of version 3.4.0 for readability). - The relevant logic for setting
cap.cantouch
in turn looks like this:
Note the Chrome block has a check for Android but the Firefox block does not; the code does not seem to consider Firefox for Android at all.//## Check Chrome desktop with touch support if (cap.cantouch&&cap.ischrome&&!cap.isios&&!cap.isandroid) { this.istouchcapable = true; cap.cantouch = false; // parse normal desktop events } //## Firefox 18 nightly build (desktop) false positive (or desktop with touch support) if (cap.cantouch&&cap.ismozilla&&!cap.isios) { this.istouchcapable = true; cap.cantouch = false; // parse normal desktop events }
Comment 5•1 year ago
•
|
||
I created a minimal page using jquery.nicescroll 3.4.0, and the issue reproduces there.
I then made a modified version of the page which uses the latest version of jquery.nicescroll, 3.7.6, and the issue no longer occurs there. This version makes the page overflow:hidden in both Firefox and Chrome, but now the event listener is active and calls preventDefault()
, so the InputResult is HandledByContent.
Given that, I'm leaning towards the resolution that we should reach out to the site author and encourage them to upgrade to a version of jquery.nicescroll that's newer than the 10-year-old version they're currently using which does not work well in Firefox for Android.
Reporter | ||
Comment 6•1 year ago
|
||
Thanks for the analysis, Botond!
We have a lot of issues with jquery nicescroll in Firefox on Android reported in https://github.com/webcompat/web-bugs/issues?q=is%3Aissue+nicescroll and indeed upgrading to the newer version usually fixes the problem.
I'll contact the site owner to see if they can upgrade and we can also ship a sitepatch in the meantime.
Reporter | ||
Comment 7•8 months ago
•
|
||
I think we can close this as it's fixed by the intervention in bug1849388
Comment 8•8 months ago
|
||
I was not able to reproduce this issue neither on Fenix Nightly 124.0a1 builds from 1/31, and 2/1.
Tested with the following devices:
- Google Pixel 6 (Android 14),
- Lenovo tablet M10 (Android 10), and
- Samsung Galaxy A14 (Android 13).
Assignee | ||
Updated•7 months ago
|
Description
•