-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Description
Currently, clicking on the overlay of a BottomSheet dismisses it entirely. However, in some use cases, it would be beneficial to have more control over this behavior.
Specifically, I would like to request the ability to configure the overlay click behavior such that:
-
Collapse Instead of Dismiss: Clicking on the overlay collapses the BottomSheet, ie, the state is changed to Collapsed instead of hidden.
-
Disable Overlay Interaction: Clicking on the overlay has no effect, keeping the BottomSheet in its current state.
Public API Changes
- Introduce a new Enum:
public enum OverlayClickBehavior {
Dismiss,
Collapse,
None
}
- New Bindable Property in BottomSheet Configuration:
public OverlayClickBehavior OverlayClickBehavior { get; set; }
Intended Use-Case
This feature is useful in situations where dismissing the BottomSheet entirely would:
- Interrupt critical workflows or ongoing interactions within the BottomSheet.
- Negatively impact multi-step workflows where collapsing is preferred over dismissal.
Example Scenario: Feedback Form in a Mobile App
A mobile app includes a BottomSheet that serves as a feedback form. The BottomSheet has multiple fields (e.g., name, email, feedback message) that users fill out and submit.
Why Collapsing Matters:
If the user accidentally taps outside the BottomSheet, dismissing it completely would result in losing all the entered information. This is frustrating for users and disrupts the experience. Allowing the BottomSheet to collapse instead ensures the form stays accessible, and the user can continue filling it out without data loss.
Why Disabling the Overlay Matters:
In scenarios where the feedback form is critical and must be completed, ignoring overlay clicks ensures that the BottomSheet remains persistent until the user explicitly closes or submits the form.