CreativeBulma / bulma-tooltip

Display a tooltip attached to any kind of element, in different position.
MIT License
76 stars 40 forks source link

Accessibility with screen readers #12

Open mel-mason opened 3 years ago

mel-mason commented 3 years ago

We've been finding this library very useful for creating tooltips (thanks!), but now trying to work out if they will be accessible for people who use screen readers. I can't find any mention in the code of aria-* attributes being added to contain the tooltip text or link the control to the tooltip element. Is that something you've implemented in another way?

Looking through the issues, I see that you've stopped the tooltip appearing on focus https://github.com/CreativeBulma/bulma-tooltip/issues/1 , which I think may make showing the tooltips when using the keyboard alone impossible. Is there any plan to make that configurable, or to somehow fix the initial problem of tooltips staying on buttons after being clicked?

Thanks for all your work on this

mel-mason commented 3 years ago

For the keyboard focus issue, if it was possible to make the state that triggers the tooltip configurable, I might be able to also fix the button clicking issue using something like https://github.com/ten1seven/what-input. In that case, I'd set it to :hover, [data-whatinput='keyboard']:focus, so that keyboard users would see the tooltip when focusing on the button, but users who clicked on the button using mouse/touch would not.