-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tab
=> direction keys handling in single-select mode
#1242
Conversation
… was changed after the function call
fea0276
to
08c6ce8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was on my list as well when the search couldn't be used. There's actually one more issue that is now introduced which is the focus class not being removed onBlur - I left a possible solution / case in my comment
var targetIsInput = target === this.input.element; | ||
if (this._isTextElement || this._isSelectMultipleElement) { | ||
if (targetIsInput) { | ||
containerOuter.removeFocusState(); | ||
this.hideDropdown(true); | ||
this.unhighlightAll(); | ||
} | ||
} | ||
else { | ||
if (targetIsInput) { | ||
containerOuter.removeFocusState(); | ||
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) { | ||
this.hideDropdown(true); | ||
this.hideDropdown(true); | ||
if (this._isTextElement || this._isSelectMultipleElement) { | ||
this.unhighlightAll(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst this works for the search not being hidden, we now don't take into account to remove the focusState on the previous outerElement when tabbing through. The previous element won't lose their is-focused
class.
We'd actually need to check for another condition afterwards to remove the previous class:
if (target === this.input.elemen) {
// your logic
}
// Remove the focus state when the past outerContainer was the target
else if (target === this.containerOuter.element) {
containerOuter.removeFocusState();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've restored that else
branch, and compiled the js files. Want to give that a test to see if that encounters any other regressions or accessibility issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already did (testing), the change looks good to me :)
No description provided.