8000 Use a wrapper for Choices.js by aschempp · Pull Request #8360 · contao/contao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use a wrapper for Choices.js #8360

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

Open
wants to merge 7 commits into
base: 5.5
Choose a base branch
from

Conversation

aschempp
Copy link
Member

Instead of reinventing accessibility for another select script or custom shadow dom handling, this simply adds a wrapper DIV to solve the Choices initialization problem. It works 99% out of the box. There might be small CSS issues still in the back end, not sure I catched everything, but they sure are easy to solve.

@aschempp aschempp added this to the 5.6 milestone May 20, 2025
@aschempp aschempp requested review from zoglo and a team May 20, 2025 14:28
@aschempp aschempp self-assigned this May 20, 2025
@aschempp aschempp requested a review from leofeyer as a code owner May 20, 2025 14:28
@aschempp aschempp added the bug label May 20, 2025
@bytehead
Copy link
Member

Didn't we agree on #8351 during the last call?

@fritzmg
Copy link
Contributor
fritzmg commented May 20, 2025

Didn't we agree on #8351 during the last call?

There are reportedly some accessibility issues with slim-select.

@zoglo
Copy link
Member
zoglo commented May 20, 2025

Didn't we agree on #8351 during the last call?

You could check out the slim select PR and it does work, however 3 Screenreaders do not read the options at all that were even read by using MooChosen:

  • NVDA
  • Microsurf
  • Apple Voiceover

Until specific bugs are fixed within SlimSelect, it would be a step backwards and mean that we'd rather solve a Turbo-Issue but exclude blind people completely..

@aschempp
Copy link
Member Author

This solves both (I presume) 🙃

@leofeyer
Copy link
Member

I think this is the best solution. @m-vo Any objections?

m-vo
m-vo previously approved these changes May 21, 2025
Copy link
Member
@m-vo m-vo left a comment

Choose a reason for hiding this comment

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

LGTM, though I think this would be the perfect opportunity to introduce a reusable template for all the selects, so that the actual markup gets an "implementation detail".

@zoglo
Copy link
Member
zoglo commented May 21, 2025

As a bugfix, shouldn't we rebase that onto 5.5 @aschempp ?

Copy link
Member
@zoglo zoglo left a comment

Choose a reason for hiding this comment

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

I did test this PR furiously with navigating back and forth and it works flawlessly better than the current implementation (In that way I am saying that I tested furiously navigating back and forth with debug mode disabled using ⌘ + ← or →😄)

There are some final style changes that need to be addressed but has been tested in filters, types and even with 'multiple' => true.

Shouldn't this however be rebased onto 5.5? (In 5.6 – Should we also rename the controller to something like select-controller and get rid of the contao-component and move the styles into our buildchain?

@aschempp
Copy link
Member Author

I'm happy to rebase onto 5.5 if we agree and once @zoglo has fixes the styling issues 🙃

@leofeyer
Copy link
Member

Definitely a bugfix for Contao 5.5 👍

@aschempp aschempp force-pushed the fix/choices-wrapper branch from 960ae9a to 30c3896 Compare May 21, 2025 15:19
@aschempp aschempp changed the base branch from 5.x to 5.5 May 21, 2025 15:19
@aschempp aschempp modified the milestones: 5.6, 5.5 May 21, 2025
@aschempp
Copy link
Member Author

Rebase done. @zoglo please add the necessary CSS changes.

@aschempp aschempp force-pushed the fix/choices-wrapper branch from 0b4f512 to 30c3896 Compare May 21, 2025 15:22
@zoglo
Copy link
Member
zoglo commented May 21, 2025

Failing tests seem unrelated to the css changes introduced in 5695869 and 5f07ab1

@m-vo
Copy link
Member
m-vo commented May 21, 2025

Should we also rename the controller to something like select-controller and get rid of the contao-component and move the styles into our buildchain?

These are both good ideas IMHO 👍. Maybe we should only apply the minimal fix as is here and add the improvements upstream, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0