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

List and ListItem issues with ARIA #140

Closed
niktek opened this issue Aug 22, 2022 · 3 comments
Closed

List and ListItem issues with ARIA #140

niktek opened this issue Aug 22, 2022 · 3 comments

Comments

@niktek
Copy link
Contributor

niktek commented Aug 22, 2022

Safari seems to be the main culprit here:

The LHS menu of the docs site, none of the ListItems are available to tab navigation - Safari only.

Looking at the /routes/components/lists/ page, clicking an item and then trying to shift tab to go up the list does not work in Safari
Kapture 2022-08-22 at 15 30 11
On the same page - tabbing to a new item and then pressing space or enter does not highlight the ListItem in FF, Chrome, Safari due to elemItem being null - line 48 in ListItem.svelte

@niktek
Copy link
Contributor Author

niktek commented Aug 22, 2022

Pretty sure this is an issue with line 48 in ListItem.svelte and that it should be reversing the ternary operands to:
parentTag === 'nav' ? elemItem.click(): elemItem.querySelector('a').click();

If parentTag is nav then the emitted tag (and therefore itemElem is a and hence querySelector('a') will always fail as it looks for an anchor inside itself. However, when parentTag is not nav, is there some benefit to trying to hit the anchor that may be nested in a slot - potential navigation ?? if not then the ternary can disappear and it can be just a elemItem.click()

This change makes highlighting via keyboard work across the board.

@niktek
Copy link
Contributor Author

niktek commented Aug 22, 2022

LHS menu issues are solved in Safari by editing settings:
image

Why it worked for the components/lists/ page when this is off makes little sense.

@endigo9740
Copy link
Contributor

endigo9740 commented Aug 22, 2022

Ugh, that's a frustrating default setting for Safari! Apple is using on the ball with user-centric defaults, so that's a big miss on their part. Hopefully folks that need this setting know about it!

Per the keypress event, you're correct, it should not need to query within itself. It should just just trigger click on itself if it's part of a nav list set. I've dropped this in in favor of a simple if statement. Good catch!

Fixed per: 3d3f9bd

(also wohoo our 700th commit!)

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

No branches or pull requests

2 participants