Skip to content

Commit 390e798

Browse files
author
Ravi Majithia
committed
Fix inconsistent traversal trough interactions using arrow keys
1 parent 86de4db commit 390e798

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/scripts/interactive-video.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,20 @@ InteractiveVideo.prototype.addSliderInteractions = function () {
11771177
}
11781178
}
11791179
});
1180+
1181+
// Maintain single tabindex through out all interactions
1182+
self.interactionKeyboardControls.on('afterNextElement', (event) => this.handleInteractionTabIndex(event));
1183+
self.interactionKeyboardControls.on('afterPreviousElement', (event) => this.handleInteractionTabIndex(event));
1184+
};
1185+
1186+
/**
1187+
* Handle after next and previous events, remove tabindex for better traversal between interactions.
1188+
*
1189+
* @method handleInteractionTabIndex
1190+
* @param {event} [event] event
1191+
*/
1192+
InteractiveVideo.prototype.handleInteractionTabIndex = function (event) {
1193+
event.element.removeAttribute("tabindex");
11801194
};
11811195

11821196
/**

0 commit comments

Comments
 (0)