Skip to content

Commit

Permalink
Ampstory tabinactive (#32867)
Browse files Browse the repository at this point in the history
* Fixed tabable links

* Moved tabindex to i-amphtml-orig-tabindex
  • Loading branch information
mszylkowski committed Feb 24, 2021
1 parent b3189e4 commit 8d7197e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions extensions/amp-story/1.0/amp-story-page.js
Expand Up @@ -1875,12 +1875,15 @@ export class AmpStoryPage extends AMP.BaseElement {
}

/**
* Set the data-orig-tabindex to the default tabindex of tabbable elements
* Set the i-amphtml-orig-tabindex to the default tabindex of tabbable elements
*/
initializeTabbableElements_() {
scopedQuerySelectorAll(this.element, Selectors.ALL_TABBABLE).forEach(
(el) => {
el.setAttribute('data-orig-tabindex', el.getAttribute('tabindex') || 0);
el.setAttribute(
'i-amphtml-orig-tabindex',
el.getAttribute('tabindex') || 0
);
}
);
}
Expand All @@ -1894,7 +1897,7 @@ export class AmpStoryPage extends AMP.BaseElement {
(el) => {
el.setAttribute(
'tabindex',
toggle ? el.getAttribute('data-orig-tabindex') : -1
toggle ? el.getAttribute('i-amphtml-orig-tabindex') : -1
);
}
);
Expand Down

0 comments on commit 8d7197e

Please sign in to comment.