WICG / modality

Experimenting with being explicit about user modality
Other
36 stars 26 forks source link

Incorrect behaviour #24

Open jonathan-fielding opened 8 years ago

jonathan-fielding commented 8 years ago

Hi

So I think this is a great idea and I immediately have a real world use case where I want to use this.

So I have a gallery which a user can tab into and control with the keyboard, I want to show that this behaviour is possible by showing that its been focussed.

At moment if I add "supports-modality" to my element what happens is when a user clicks on my element (which also has tab-index set to 0 to enable it to be in the tab order) the focus is applied.

What I believe should happen is when a user clicks on it, the focus should not be applied. When the user uses keyboard to get to the element (tabs to it) then the modality focus should apply as keyboard is being used.

Please let me know if I am completely misunderstanding the aim of this and feel free to close if appropriate

Thanks

Jonathan

robdodson commented 7 years ago

I think you want to remove the supports-modality="keyboard" on your element. That attributes opts you in to displaying the focus ring. If you remove it, then the element will not display the focus ring on mouse click.