Skip to content

feature idea: dismiss sheet on swipe down, but not on tap outsideΒ #20

@eins78

Description

@eins78

I have a use case for this library where I want the user to be able to dismiss the sheet by swiping down on the drag handler, but not when tapping/clicking outside of the sheet. Dismiss via ESC key should also work.

I can think of 2 ways for an API:

  1. onDimiss gets an argument like cause: "tap-outside" | "swipe-down" | "esc-key", so I can decide in the handler if I want to call setOpen(false) or not
  2. specific (boolean) props to turn off dismissal methods: closeOnTapOutside, closeOnOutside, closeOnEscKey

Would you accept a PR for this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions