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
Right now data-focus-source makes it possible to tell keyboard from pointer as the source of focus. We (@halmos and I) would like to be able to further distinguish different types of pointers. The use case is to be able to provide a thicker (or otherwise more visible) focus outline on touch, because you can't see what's under your finger.
In terms of how this gets exposed, I don't think we can change data-focus-source without breaking compatibility. So that would always reflect "pointer". But we can add a second data attribute, say data-pointer-type, that could contain touch/mouse/stylus/catpaw/headbang/etc.
I like your approach! Much simpler than what I had in mind.
I think I'd call the attribute data-focus-source-pointer="<value>". And <value> would returned by observe/interaction-type as a third property called pointerType, with its value defined by event.pointerType. I assume there's no mix'n'match, so modality-specific counters don't seem necessary. <value> would default to null, be "touch" for event.type === "touchstart", "mouse" for event.type === "mousedown" and otherwise whatever event.pointerType returns.
Right now
data-focus-source
makes it possible to tell keyboard from pointer as the source of focus. We (@halmos and I) would like to be able to further distinguish different types of pointers. The use case is to be able to provide a thicker (or otherwise more visible) focus outline on touch, because you can't see what's under your finger.In terms of how this gets exposed, I don't think we can change
data-focus-source
without breaking compatibility. So that would always reflect "pointer
". But we can add a second data attribute, saydata-pointer-type
, that could contain touch/mouse/stylus/catpaw/headbang/etc.In terms of implementation, just giving it a quick look I believe that https://github.com/medialize/ally.js/blob/master/src/observe/interaction-type.js could expose that distinction (since it knows what event it's reacting to) by incrementing/decrementing modality-specific counters in addition to the pointer one, and then that https://github.com/medialize/ally.js/blob/master/src/style/focus-source.js#L52 could simply make use of that information.
We're open to other approaches of course, this is just what we've thought up. If you're up for this, we'd be happy to file a PR.
The text was updated successfully, but these errors were encountered: