-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popover accessibility #18618
Comments
Does this apply to Tooltips too? Or why not?
Yeah, I'd very much suggest avoiding that. Breaking the next-sibling CSS combinator is a bad scene. |
no, as tooltips use this won't help in this case, as |
Well, technically folks can put arbitrary HTML into a tooltip too. Admittedly, it's less common than with popovers. |
This is still an issue. Would like to revisit this ideally for v4.0, failing that for v4.1 |
Maybe, in the cases of popovers with longer content or interactive content, adding to the trigger element an Making the popover container have a tabindex of "-1" and focusing it on open might be in order, (but that also depends on the trigger types... Tabbing out of (i.e. focus ring) the popover should go to the trigger element, and while popover is open, tabbing would jump back into the popover. This would be similar to modal's contain focus, but allowing focus to move back and forth between the popover and the trigger element (trigger element would of course need to be focusable). This would not work with the focus out hiding of popover. So maybe inserting popover into the tab sequence after the trigger button (somehow... it is not easy to determine an elements actual tab order) But maybe for this use case, if trigger is only click, then this tab containment would be desirable. Just thinking... once option of controlling the tab order for keyboard users would be if a blur happens on the trigger element, focus could be moved to the popover container.and if tab leaves the popover container, it is trapped and the trigger element is them focused, and then blurred (or simulate a tab key press event on the element), causing the next element in the document order (after the trigger element) to be focused. OR a jquery selector (for focusable items that are not inside of something with tabindex of -1) which is then sorted by element tabindex (if people have added tab indexes, which they shouldn't), and then use a find in that array to find the trigger element, and then focus the next). Not ideal, but very possible to do. For tooltips, I have seen many instances where they are given a role of Maybe the role maybe should be configurable 9and default differently for popover vs tooltip). The shown/hidden events could be used by authors to move focus into or out of the popovers, rather than trying to automate that into the tooltip/popover class code. |
I've been working on Bootstrap-Vue's tooltip and popover implementation (to use Popper.js), and have been considering adding in a configurable This involves abstracting a few of the Another option we're considering adding in is |
I've been messing around with a solution for popover tab management in React here. It's not specific to Bootstrap, but If it seems like a viable solution I'd love to make a small utility that this library as well as others could use. It follows some of what @patrickhlauke discussed above, excluding any of the aria attributes. I wasn't sure exactly the best way to handle it, but hopefully it's a good start that can be iterated on 🤷♂️. |
Should we close this as stale? |
I'm guessing that it might be best to leave "interactive" popover accessibility as an exercise to the coder/user. Regular popovers (with no interactive content), are handed by the |
@patrickhlauke what is an AT user? |
AT is Assistive Technology |
@tmorehouse Thank you, I figured it would be something like that, but it was awfully hard to google. I do not believe this issue is stale |
going to try to more properly tackle some aspects of the "popovers with interactive content" over here #28446 for my 3rd original point. points 1 and 2 were addressed originally by also adding |
Current implementation of popover http://v4-alpha.getbootstrap.com/components/popovers/ / http://getbootstrap.com/javascript/#popovers has a series of accessibility issues:
A fix for these is non-obvious, as it may depend on the nature of the popup itself (whether it only contains text/info, or also interactive controls). If it were just short content, an approach similar to tooltip (using
aria-describedby
) could be used, but if the content is structured/long, this won't be ideal. Tending to think that initially, once the popover is triggered, focus should be moved to the popover and kept inside it (effectively making it a modal), though then it needs a way of escaping back to the main document (ESC key to close it and return focus back to the trigger, though lack of a visible/focusable/actionable close control may be a problem). Failing that some focus juggling that means the popover is somehow injected directly after its trigger, though this would clearly cause display / z-index / stacking order issues.The text was updated successfully, but these errors were encountered: