Skip to content
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

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

ldavidson45
Copy link
Contributor

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:
2020-10-29 11 08 39

And Voiceover/Safari:
2020-10-29 11 17 13

removeOptionAndHandleFocusShift(index: number) {
this.removeOption(index)
this.$nextTick(() => {
if (this.selectedOptions.length === 0) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perffff

Copy link
Contributor

@jackkoppa jackkoppa left a 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

@ldavidson45 ldavidson45 merged commit 140519c into main Nov 6, 2020
@ldavidson45 ldavidson45 deleted the liz/focus-shift branch November 6, 2020 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants