Skip to content

Commit

Permalink
Fix tab selection on programmatic focus (initialSelection)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotherightthing committed Sep 24, 2020
1 parent 51bc553 commit cc2eac8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/classes/keyboard-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ class KeyboardHelpers {

focussed.setAttribute(selectedAttrProp, selectedAttrVal);

// if focus was result of a click action
if (!this.selectionFollowsFocus) {
this.updateRovingTabIndex(focussed);
}
// this is required if focus was result of a click action
// or if element was programmatically focussed
// otherwise it's redundant
this.updateRovingTabIndex(focussed);

if (typeof e === 'object') {
if (this.toggleAfterSelected) {
Expand Down

0 comments on commit cc2eac8

Please sign in to comment.