Open dmitry-kurmanov opened 6 months ago
I think we can make test like:
if ((el.target.tagName === 'BUTTON' || e.target.role === 'button' || …) & el.target.closes('[role=toolbar]')) {
@ai I will try to implement it if you don't mind.
After some investigation I changed my mind about el.target.tagName === 'BUTTON'
. I suppose we shouldn't support it. By default button has submit
type, so to make buttons work properly in the toolbar
they should have explicitly set of type="button
. See the the toolbar example
That is why I propose not to use the tag selector for the button
.
After some investigation I changed my mind about el.target.tagName === 'BUTTON'. I suppose we shouldn't support it. By default button has submit type, so to make buttons work properly in the toolbar they should have explicitly set of type="button. See the the toolbar example
OK
Moreover, probably instead of a list of available item types we could support any focusable type via the node.tabIndex property.
Adding tabindex
on button
/input
/a
looks not very elegant.
After some investigation I changed my mind about el.target.tagName === 'BUTTON'. I suppose we shouldn't support it. By default button has submit type, so to make buttons work properly in the toolbar they should have explicitly set of type="button. See the the toolbar example
OK
Moreover, probably instead of a list of available item types we could support any focusable type via the node.tabIndex property.
Adding
tabindex
onbutton
/input
/a
looks not very elegant.
I removed the comment because the "tabindex idea" will not work. We set tabindex='-1'
to prevent extra tab focus while we are inside the focus-group
. I will think how to implement it.
based on https://github.com/ai/keyux/issues/9#issue-2151620436