DestinyItemManager / DIM

Destiny Item Manager
https://destinyitemmanager.com
MIT License
2.07k stars 645 forks source link

Scroll Body Lock not working in Chrome #5615

Open kyleshay opened 4 years ago

kyleshay commented 4 years ago

What Browser and OS are you using? Chrome-based (Android or Desktop)

Describe the bug and how to make it happen When I tap an item and view the item details, I'm able to swipe up and down on the Sheet and move the inventory behind it. This is an issue when swiping to close the Sheet. Swiping down closes the sheet, but it also scrolls you to the top of the page.

foo

bhollis commented 4 years ago

Did this start recently?

kyleshay commented 4 years ago

not exactly sure. https://github.com/DestinyItemManager/DIM/issues/5547 leads me to believe that it is at least that old (user scrolling behind the sheet to add items)

kyleshay commented 4 years ago

FYI this is just for the item popup, other sheets lock as expected.

bhollis commented 4 years ago

Interesting - scroll lock is handled by Sheet, not the popup, which makes me think some CSS is maybe overriding something?

kyleshay commented 2 years ago

It seems that the background never locks on Android, you can always tap and scroll it— though that's fine (almost even preferred? — on iOS the background is totally locked.)

The main issue is that when you're touch-dragging on the sheet, the background shouldn't move. Seems like anywhere on the header the body locks, and anywhere in the horizontal scroll area it locks. Weirdly just doesn't lock where the stat names are on the far left.

https://user-images.githubusercontent.com/424158/147706161-22024dc6-d7a2-421a-920b-5b256e60fb96.mp4

bhollis commented 2 years ago

I think I have an idea. The sheet is supposed to block touch events from bubbling out of the sheet itself, but chrome changed to automatically convert touchstart events to passive even if you didn't register them that way. So perhaps we need to register them ourselves with passive: false.

kyleshay commented 2 years ago

Ooh hmm good call—just tried sheetContents.current.addEventListener('touchstart', blockEvents, { passive: false }); in Sheet.tsx to no avail :(

liamdebeasi commented 3 months ago

I'm not able to reproduce this on Android, though maybe I'm not following the correct steps? I'm running a WebView with Chromium v125. I am able to scroll the body underneath the overlay directly, but that seems to be different than what is being reported here.

https://github.com/DestinyItemManager/DIM/assets/2721089/376896b2-dee0-441b-a3d8-65bf1af7a196

Worth noting that I reported a similar issue to the Chromium team earlier this year. However, given that the issue in DIM dates back to 2020 I'm not sure these are exactly the same.