You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
Users that navigate the PWA via a keyboard will not be able to see the currently focused item because outline: none is set to all interactive elements.
Steps to Reproduce
Steps to reproduce the behavior:
Go to the pwa version of any Ionic application
Use tab key to navigate through interactive elements like buttons, links, etc.
See that no focus styles exist
Related Code
I noticed that outline: none is set on a few focusable items, for example:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Bug Report
Ionic Info
Run
ionic info
from a terminal/cmd prompt and paste the output below.Describe the Bug
Users that navigate the PWA via a keyboard will not be able to see the currently focused item because
outline: none
is set to all interactive elements.Steps to Reproduce
Steps to reproduce the behavior:
tab
key to navigate through interactive elements like buttons, links, etc.Related Code
I noticed that
outline: none
is set on a few focusable items, for example:https://github.com/ionic-team/ionic/blob/802a3d14e75a26ef7c6c4677ff4705401009df73/core/src/components/button/button.scss#L214
https://github.com/ionic-team/ionic/blob/8029df344a24d2b5096efbe590485a5c9d61a262/core/src/components/input/input.scss#L69
https://github.com/ionic-team/ionic/blob/0abf992a136a34af66ea121f11e11fd5d9092d16/core/src/components/searchbar/searchbar.scss#L79
https://github.com/ionic-team/ionic/blob/8029df344a24d2b5096efbe590485a5c9d61a262/core/src/components/toggle/toggle.scss#L19
See search query for "outline: none" in this repository
Expected Behavior
Keyboard users should be able to see the currently-focused item.
Suggested Solution
I suggest that instead of removing the
outline
outright, we instead make use of the:focus-visible
pseudo-class:The support for
:focus-visible
is still pretty low right now, but we can make use of the polyfill.Also, this may only be a problem for the PWA so the styles and polyfill could be loaded only for that and not the native applications.
Let me know what you think, I would like to submit a PR implementing this.
The text was updated successfully, but these errors were encountered: