Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
fix test, add comment for supporting ShadowDom v1
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi committed Oct 26, 2016
1 parent 8b7f616 commit e5fa398
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions iron-focusables-helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@
result.push(element);
}

// In ShadowDOM v1, tab order is affected by the order of distrubution.
// E.g. getTabbableNodes(#root) in ShadowDOM v1 should return [#A, #B];
// in ShadowDOM v0 tab order is not affected by the distrubution order,
// in fact getTabbableNodes(#root) returns [#B, #A].
// <div id="root">
// <!-- shadow -->
// <slot name="a">
// <slot name="b">
// <!-- /shadow -->
// <input id="A" slot="a">
// <input id="B" slot="b" tabindex="1">
// </div>
// TODO(valdrin) implement ShadowDOM v1 when upgrading to Polymer v2.0.
var children;
if (element.localName === 'content') {
children = Polymer.dom(element).getDistributedNodes();
Expand Down
2 changes: 1 addition & 1 deletion test/iron-overlay-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ <h2>Focusables (with tabindex)</h2>

test('with-backdrop: after open, update last focusable node and then Shift+TAB', function(done) {
overlay.withBackdrop = true;
var focusableNodes = overlay._focusableNodes;
runAfterOpen(overlay, function() {
var focusableNodes = overlay._focusableNodes;
// 1ms timeout needed by IE10 to have proper focus switching.
Polymer.Base.async(function() {
// Before tabbing, make lastFocusable non-tabbable. This will make
Expand Down

0 comments on commit e5fa398

Please sign in to comment.