Open danloomer opened 1 year ago
Hi! We noticed there hasn’t been activity on this issue in a while. After 30 days, it will close automatically.
If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.
Hi! We noticed there hasn’t been activity on this issue in a while. After 30 days, it will close automatically.
If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.
Issue summary
When you pass a
RefObject
to theModal
component'sactivator
prop and thatRefObject
points to the focusable activator itself (rather than a container) the focus will not be applied when the modal closes.The root cause seems to be that the
focusFirstFocusableNode
utility we use to achieve the focus has an optionaldescedentsOnly
argument which defaults to true.Expected behavior
Focus should return to the activator even when the ref passed is to the focusable element itself.
Actual behavior
It does not focus the activator.
Specifications