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

Switch to AlphaGov Accessible Autocomplete to fix tabbing #71

Closed
wants to merge 10 commits into from

Conversation

iandunn
Copy link
Member

@iandunn iandunn commented Apr 12, 2023

Fixes #70

@iandunn
Copy link
Member Author

iandunn commented Apr 12, 2023

This seems to be working well initially, but I still wanna play around w/ some of the API options. After that it'll need styling and cleanup.

@iandunn iandunn added this to the WP20 launch milestone Apr 12, 2023
@adamwoodnz adamwoodnz modified the milestones: WP20 launch, Post launch Apr 13, 2023
@iandunn iandunn self-assigned this Apr 13, 2023
@iandunn iandunn force-pushed the locale-tabbing branch 2 times, most recently from 0ce2657 to a2798ed Compare April 14, 2023 16:35
@iandunn
Copy link
Member Author

iandunn commented Apr 19, 2023

Getting the basics working was pretty easy, but I've been struggling to shoehorn it into the design. I've considered switching to the latest version of Select2, since it might have fixed the bug, and wouldn't need any design changes. I'm guessing it still has a wide range of a11y issues that SelectWoo has fixed, though. We could try another modern a11y-first select library, but we might run into similar issues there. We could also try porting the fix from Select2 to SelectWoo, but that could also be a rabbit hole since they've diverged so much.

@adamwoodnz Your CSS skills are better than mine, do you mind taking a look at this branch and letting me know if you have any ideas to get the style working? It's hard to describe specific problems because there are so many, and they change depending on what approach I take. I'm wondering if you start from scratch, do you see a way to get just the fundamentals working with the design? If so, I could pick that up and polish all the little details.

@iandunn
Copy link
Member Author

iandunn commented Apr 19, 2023

start from scratch

If you see a better way, feel free. Starting from scratch was just what made sense to me.

@iandunn
Copy link
Member Author

iandunn commented Apr 21, 2023

I just remembered that Learn has a switcher too, and @coreymckrill had a really good idea there:

The switcher uses WP/Gutenberg's native Combobox component for selecting the locale, rather than the select2 JavaScript library (or the selectWoo variant). The hope is that this will be both more accessible and more maintainable, since the future of development for select2/selectWoo is uncertain.

That's been on Learn for two years without any reports of problems.

It might also be difficult to work that into the current design, but if we're going to have trouble no matter what, then it seems like a better solution to me. It seems like the markup might be a closer fit to what the WP20 nav menu uses, though, where there's button to toggle it and that's a separate element tree from the list itself.

@adamwoodnz what are your thoughts on that, and the current styles? If you think Combobox would be better I could try that out in a new PR.

@adamwoodnz
Copy link
Contributor

If you think Combobox would be better I could try that out in a new PR.

Using WP/Gutenberg does seem like a good call. I reckon give it a try.

I'll also push my branch for the AlphaGov switcher, as I've got the styles pretty close. We can then compare.

@adamwoodnz adamwoodnz mentioned this pull request Apr 27, 2023
@adamwoodnz
Copy link
Contributor

I'll also push my branch for the AlphaGov switcher, as I've got the styles pretty close.

My PR is here, give it a whirl.

@iandunn
Copy link
Member Author

iandunn commented May 2, 2023

That's looking really good, great work 🎉

Since it's so close, IMO it's best to to stick with that. If we ever have a need for major changes, we can try testing out ComboboxControl. I'll push some commits to #93 to clean up some of drafted code, and I think we'll have something that's good to go 👍🏻

@iandunn
Copy link
Member Author

iandunn commented May 2, 2023

Closing in favor of #93

@iandunn iandunn closed this May 2, 2023
@adamwoodnz adamwoodnz deleted the locale-tabbing branch May 18, 2023 01:42
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.

Can't tab to locale search field
2 participants