Skip to content
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

Feature: Make Bottom Sheet non-dismissible by swipe down #49

Open
nilufer32 opened this issue May 22, 2024 · 6 comments
Open

Feature: Make Bottom Sheet non-dismissible by swipe down #49

nilufer32 opened this issue May 22, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@nilufer32
Copy link

It would be great if there were an option for disabling any dismissal of the bottom sheet by swiping it down

@alexzhirkevich
Copy link
Owner

alexzhirkevich commented May 22, 2024

If you want to disable swipe there is a sheetSwipeEnabled option.

If you want to allow swipe but ignore anchor changes you can return false in the confirmValueChange

confirmValueChange: (CupertinoSheetValue) -> Boolean = { true },

@nilufer32
Copy link
Author

Won't this disable swiping the sheet completely? I want to only disable dismissing the sheet by swipe down, but I want to be able to swipe the sheet between different detents/heights

@nadeeen1
Copy link

@alexzhirkevich Also i just tested sheetSwipeEnabled = false , using 2 detente Medium and Large and it doesn’t seem to disable swiping at all

@alexzhirkevich
Copy link
Owner

Won't this disable swiping the sheet completely? I want to only disable dismissing the sheet by swipe down, but I want to be able to swipe the sheet between different detents/heights

Then you need to return false for the Hidden state only in confirmValueChange lambda

@nadeeen1
Copy link

@alexzhirkevich I suppose this works, however i was wondering if there was a way to completely stop the sheet from sliding down when it reaches a certain detent. Returning false in the confirmvaluechange block will allow swiping down a bit then bouncing back to the original state, when what i’m looking for is to completely block the downward swipe gesture.
Thank you very much for taking the time to respond and for the effort you’re putting in.

@alexzhirkevich
Copy link
Owner

alexzhirkevich commented May 22, 2024

if there was a way to completely stop the sheet from sliding down when it reaches a certain deten

Unfortunately no. You can only disable it completely when it reaches some state. You can't limit swipe by minimum detent

@alexzhirkevich alexzhirkevich added the enhancement New feature or request label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants