-
Notifications
You must be signed in to change notification settings - Fork 38
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
Rename findSpatNavCandidates() to findFocusableAreas() #31
Comments
I think there are two parts in your proposal:
|
We could include the used spatnav-container in an I think we better not let the container-argument be optional. That helps authors think about containers before using the API. Still, lazy developers can just do When a second, not so lazy, developer comes along, he/she could otherwise wonder "Was this really the intended search container?" "Did we forgot to specify a container here"?. |
Though startelement is invisible, findFocusableAreas() returns visible focusables (candidates).
At this point, I have another question. What if the container isn't visible?
This is a good idea!
I'm inclined to let the startelement mandatory and container optional. Unless there is an API for finding the container, making the container mandatory seems less intuitive.
To polyfill nav-rule means to replace selectSpatNavBestCandidate() . Do I understand right? |
My understanding is that none of the JS methods triggers NavigationEvent. They are only used to query information (but not change state). Authors will still move focus with The JS API will typically be used in a
Hmm... Maybe not. To polyfill nav-rule, I think we only really need to provide a cancelable
Finding the parent scroller could be done manually [1] [2]. One could do
I like it because it resembles querySelectorAll's syntax. |
By moving the stepts that take the direction and starting point into account from finding candidates to selecting the best one, the "finding candidates" method can be made more generic. This patches does that, and renames the relevant algorithm and API accordingly. This includes a convenience method to grab the nearest spatnav container ancestor. Closes WICG#31
By moving the stepts that take the direction and starting point into account from finding candidates to selecting the best one, the "finding candidates" method can be made more generic. This patches does that, and renames the relevant algorithm and API accordingly. This includes a convenience method to grab the nearest spatnav container ancestor. Closes WICG#31
By moving the stepts that take the direction and starting point into account from finding candidates to selecting the best one, the "finding candidates" method can be made more generic. This patches does that, and renames the relevant algorithm and API accordingly. This includes a convenience method to grab the nearest spatnav container ancestor. Closes WICG#31
By moving the stepts that take the direction and starting point into account from finding candidates to selecting the best one, the "finding candidates" method can be made more generic. This patches does that, and renames the relevant algorithm and API accordingly. This includes a convenience method to grab the nearest spatnav container ancestor. Closes WICG#31
Currently, the suggested API could be used like this:
anyelement.findSpatNavCandidates({dir: "left", somecontainerdiv});
I'd like to flip the perspective. Now we expose this method on the element from where we want to "measure reachability" of candidates. I'd like to call this method on the node whose sub tree I want to search. I think that would result in JS that's slightly more pleasant to read.
div.findFocusableAreas()
// Returns all visible focusables within the div.div.findFocusableAreas("left")
// Visible focusables within the div that are left of document.activeElement().div.findFocusableAreas("left", startelement)
// Visible focusables in the div that are left of startelement.Question: What if startelement isn't visible?
I think that reads better than the current draft's: "If c is null, set c to the nearest ancestor of eventTarget that is a spatnav container."
The text was updated successfully, but these errors were encountered: