Skip to content
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

Using Spatial Navigation Action API #185

Open
jervisfm opened this issue Jun 7, 2019 · 0 comments
Open

Using Spatial Navigation Action API #185

jervisfm opened this issue Jun 7, 2019 · 0 comments

Comments

@jervisfm
Copy link
Contributor

jervisfm commented Jun 7, 2019

Hi,

In the spatial navigation action polyfill demo (https://wicg.github.io/spatial-navigation/demo/sample/api_spatial_navigation_action.html), the demonstrated usage is explicitly setting the --spatial-navigation-action property directly on the element. Code link:

boxes[i].style.setProperty("--spatial-navigation-action", behaviorOption.value);

The current released implementation uses element.style.getPropertyValue to read the custom property value. Link:

return element.style.getPropertyValue(`--${varName}`).trim();

The result of this is that styles that are applied by a CSS stylesheet do not seem to be picked up and so the automatic "focus" navigation is not enabled for them.

Just wanted to ask if the intended usage for this API is directly setting the style property inline on the applicable elements and not via a CSS stylesheet?

One can imagine that using getComputedStyle as is to get the overall computed styles might be expensive and thus it's not done here.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant