Repository navigation
Selectively hide focus ring via :focus-visible polyfill support - #660
Conversation
|
cc @yuinchien @mrdoob just a heads up that our focus rings will be improved soon 🖖 |
|
cc @robdodson |
elalish
left a comment
There was a problem hiding this comment.
Surprising how much boiler plate is necessary to include this polyfill.
| }; | ||
|
|
||
| // IE11 doesn't natively support custom elements or JavaScript class | ||
| // syntax The mixin implementation assumes that the user will take the |
There was a problem hiding this comment.
| // syntax The mixin implementation assumes that the user will take the | |
| // syntax. The mixin implementation assumes that the user will take the |
Are you referring to the docs modifications required? |
|
No, just the new mixin with the coordinator and event listeners and such. |
|
@elalish it's true, and unfortunate. If you are interested in the gritty details, I recommend reviewing WICG/focus-visible#196 |
Opt-in to :focus-visible polyfill when available (google#660)
|
hello everyone, unfortunately I don't know my way around - I'm more of a user. On my website I still have the problem with: focus. Can someone help me there? |
|
just make sure the focus-visible.js is included in your header. You probably started your modelviewer page with an older example that didn't have it included. pick it up from the repo or this link: |
|
@mithru THX! works perfectly |
|
Adding "data-js-focus-visible" attribute to model-viewer removes the outline without any external dependency. |
|
@Bihan001 Are you sure? Doesn't it still need the polyfill included? Can you show a Glitch example or something? |
I'm using react and no polyfill or additional styling was required, simply adding the attribute to model-viewer removed the outline for me. |
|
@Bihan001 I'm guessing that means the focus-visible polyfill is included by default in React. |
:focus-visiblesupportThis change proposes that we integrate with the
:focus-visiblepolyfill (finally possible now that WICG/focus-visible#196 has landed in a release), and rely on its signaling to selectively disable the default focus ring for non-keyboard interactions.Additional highlights of this change include:
Examples
:focus-visiblepolyfillFixes #463