Closed alex-e-leon closed 2 years ago
A very good suggestion. I like it.
Now(react-focus-lock@2.9.0) one can control autofocus behavior by setting data-no-autofocus
on an element or container - https://github.com/theKashey/focus-lock#declarative-control
That should let you control autofocus behavior as desired.
Thanks @theKashey - I'll test it out and report, but this looks great : )
Tested locally, and seems to work great.
:yay:. thank you for pointing on the idea as well as the implementation. From some point of view - that's all your doing.
In my application I have tooltips like this:
Which according to WCAG should be focusable - however having a tooltip focused and shown whenever a dialog is opened is a pretty strange behaviour.
It would be nice if I could "blacklist" the element, possibly by adding a data-attribute (maybe something like
data-no-autofocus
, so that focus-trap would focus the next element instead when a dialog is opened.