Skip to content
Discussion options

You must be logged in to vote

The Dialog behaves like that because of its modal state. Users can't interact with elements outside a modal dialog. hideOnInteractOutside only controls whether the Dialog will hide.

You can temporarily disable the modal state while showing the notification with something like this:

const [modal, setModal] = useState(false)

<Dialog backdrop modal={modal} hideOnInteractOutside={...}>
  <Button
    onClick={() => {
      setModal(false)
      toast.success("Foo", { onClose: () => setModal(true) })
    }}
  />
</Dialog>

However, the notification element should ideally be considered a nested non-modal dialog while the original Dialog should keep its modal state. We need a better way to handle…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@diegohaz
Comment options

Answer selected by georgekaran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants