You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useElementShouldClose conflates too many events into one hook, without the ability to configure it more specifically. It currently invokes the provided close callback for any external click, external focus or the keypress of Esc. You can't opt in or out of any of these.
Arguments:
With the re-implementation of Dialog, the away-focus handling won't make sense as the component will focus-trap.
Sometimes we don't want to close a modal on click-away (it becomes too easy, e.g., to accidentally dismiss the modal, as is the case in the LMS file pickers)
Sometimes we want to react to Esc, but not a click-away
We might consider decomposing this hook, e.g., maybe (just one option here):
useClickAway and useFocusAway, or useAwayEvent (hook that could take multiple events)
useKeyPress specifically for keyboard event handling
There are a number of plausible options here...
The text was updated successfully, but these errors were encountered:
useElementShouldClose
conflates too many events into one hook, without the ability to configure it more specifically. It currently invokes the provided close callback for any external click, external focus or the keypress ofEsc
. You can't opt in or out of any of these.Arguments:
Dialog
, the away-focus handling won't make sense as the component will focus-trap.Esc
, but not a click-awayWe might consider decomposing this hook, e.g., maybe (just one option here):
useClickAway
anduseFocusAway
, oruseAwayEvent
(hook that could take multiple events)useKeyPress
specifically for keyboard event handlingThere are a number of plausible options here...
The text was updated successfully, but these errors were encountered: