Matt B
Matt B

Reputation: 6322

How can tabindex be used in a Polymer component that is used multiple times in a page?

Currently I have a polymer element which contains a form with a few different fields. I have a tabindex setup on the input elements, however this polymer element is repeated 5 times throughout the page.

When I use tab for navigation, instead of following the tabindex within each component first, it instead goes to tabindex 1 for each component. Then all the tabindex 2's, and so forth. Is there any way for the tabindex to be encapsulated with/in the shadow dom?

Upvotes: 2

Views: 1606

Answers (1)

Hayato Ito
Hayato Ito

Reputation: 134

You might want to see a '7.2 Focus Navigation' section in the Shadow DOM spec. http://w3c.github.io/webcomponents/spec/shadow/#focus-navigation

Tabindex should be scoped in each node tree. Google Chrome already supports that. I've implemented that. :)

  • If you find any unexpected behavior in the implementation, please file a bug for Chrome: http://crbug.com/
  • If you find an issue for the spec, please file a bug for the spec: Click a 'file a bug' button displayed at the top-right corner in the Shadow DOM spec.

Upvotes: 2

Related Questions