-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sheet not closing on mobile #154
Comments
same problem, any news on this issue? |
Hello everyone, I encountered the same problem, in my case I removed the Header, and wanted to make my own, but on mobile I encountered a problem that the panel did not collapse, but only jumped slightly from top to bottom. The solution turned out to be quite simple, I added the draggable={false} attribute to my own Header (which is not located at the top of the hierarchy), and everything began to work as expected |
Not really. I did a workaround |
Share your solution? |
Still having the same problem. |
Hi @Knaackee 👋 The Is the problem that the sheet is not draggable at the top/bottom positions? That would be a bug. Does this example demo work for you? At least on my iPhone it works nicely: sheet is dragged down from body area when the sheet is not scrolled and when the sheet scroller is scrolled all the way to bottom the sheet can be dragged upwards. |
Hello @Temzasse I've also encountered this issue. Your demonstrative example doesn't work on Android mobile devices. I tested it on Chrome and Firefox browsers. I can also reproduce this problem on a computer in the Chrome browser. Under normal conditions, the modal window behaves correctly, but when I switch to a mobile device, it stops closing. |
Hello! |
Same here. More precisely, on android :
|
Would gladly help, but I'm a bit lost, the code is more complicated than I thought :) |
Mmmh, found something interesting ! On chrome mobile (well at least Bromite and Kiwi), drag works... with two fingers ! On chromium desktop in mobile dev mode, shift + drag works too (simulates two fingers). Can also confirm that using two fingers solves the problem for firefox when content height -> scroll.
|
First I tried to resolve this by setting "overflow:hidden" when the user started to drag. But it doesn't work. Now trying to use the "touch-action" css prop thanks to this issue and getting interesting results, though not good enough yet. I'm trying things on the lib locally in my repo cartesapp/cartes@a0e2377 |
Unfortunately, firefox and safari do not support "pan-down"... Edit : I implemented a small hook to detect the direction of the pan. |
It's not ideial but I'm using this to prevent the page from refreshing: useLayoutEffect(() => {
if (isOpen) document.querySelector('body')!.style.overscrollBehavior = 'none'
return () => {
document.querySelector('body')!.style.overscrollBehavior = 'unset'
}
}, [isOpen]) I think it will still take a moment for users to figure out how to close it, but I also have |
Hi, from what I tested https://github.com/emilkowalski/vaul tackles this behavior on chrome correctly, maybe we could get some inspiration from them. |
@Temzasse seems it can be realised just detecting that scrollable body position now at the top then we can enable swipe functionality |
I have the same problem using |
Having the same problem here, on Firefox/Android. I'm not able to swipe to close on this demo either. |
Also having the same issue, if sheet.scroller is being used the sheet cannot be dragged down on Android, no issues on iOS. |
Feel free to try my embedded fork deployed at https://cartes.app. If it solves your problem, someone could consider making a PR. |
At first, thanks for the great work!
I am unable to “swipe to close” the sheet on mobile while using the
<Scroller/>
.Without the scroller, it works. It works on the drag indicator but not on the content area.
Any idea?
The text was updated successfully, but these errors were encountered: