-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add method to handle focus shifting when selected pill is clicked #45
Conversation
src/SelectMulti.vue
Outdated
removeOptionAndHandleFocusShift(index: number) { | ||
this.removeOption(index) | ||
this.$nextTick(() => { | ||
if (this.selectedOptions.length === 0) { |
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.
Super tiny but looks like this should be indented one more level since it's inside a block?
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.
Thanks for catching that @hungsu ! I'll fix that before merging
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 wonder if people would object to our eslint rules being moved to a public repo? Then we could use them here...
class="selected-option-pill" | ||
:disabled="disabled" | ||
type="button" | ||
:aria-describedby="`${htmlId}-selected-option-pills`" | ||
@click="removeOption(index)" | ||
@click="removeOptionAndHandleFocusShift(index)" |
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.
perffff
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.
Love it! Seems to make total sense. Let's resolve the merge conflict & indentation before merging
b02c6d2
to
a3c2b41
Compare
We know that NVDA does not announce the element focused in some instances (detailed here nvaccess/nvda#5825 (comment))
Here is the NVDA/Firefox screenreader & focus shifting behavior:
And Voiceover/Safari: