-
Notifications
You must be signed in to change notification settings - Fork 37
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
Replace Chosen with accessible-autocomplete #1161
Conversation
I'd happily take the chosen replacement as-is and backlog a ticket to figure out categorization. |
👋 Resident Chosenista here. Chosen does that through |
@hbillings Hmm - having no real information about why the groupings were created in the first place, it's hard to say. Based on some research of late... This tells me categories exist because business units are important, ie, there was a situation where non-18F units were billing to 18F tock lines because they didn't know the distinction. I'd argue for keeping categories. Can we transfer over the drop down categorization in some fashion? maybe @Jkrzy or @tbaxter-18f can speak to the legacy of that feature. |
The groupings are derived from 'AccountingCode's and originated in PR #23, ~5 years ago. It also looks like accessible autocomplete doesn't have an existing path to categories. alphagov/accessible-autocomplete#145 +1 to Neil's thought, we know we need to move away from Chosen. Let's sort out if/how we need to enhance that UI after it's in place. |
@Jkrzy I like the option in that example of using the custom template option to add a hint to the text. That would probably be a pretty easy enhancement (whether it needs to go in this PR or not is another story). (I share your concern about business units tocking to the wrong lines, @arouault, and I'd like to try to mitigate that if possible! I think it might require a little creativity and trial-and-error, though.) |
Tocking to the wrong line should be difficult since we added the enhancement this year to only show tock lines for your org. I know you can create Django choices with optgroups, but I don't know if the accessible autocomplete would work well with them or not. I agree with the above. It's a feature of only limited benefit, and we can log a follow-up issue to bring it back if we want to. |
@hbillings, let me know if there's a more convenient way the backend can be providing |
I went back to write the test I thought this needed, and I don't actually think it needs one. We'd basically just be testing the Chosen library. |
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.
A few clean-up comments, but this looks good! Giving a preemptive 👍 assuming the comments are addressed.
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 @Sgtpluck!
Description
Closes #1109. Chosen.js is not accessible; replace it with accessible-autocomplete.
Todo:
Looks like this closed:
And this expanded:
I'm wondering what we'd like to do about the dropdown. Currently, Tock's dropdown separates projects into categories, although I have to admit I'm a little unsure how it's doing that:
I'm also not clear on whether this is a feature that people would miss if it disappeared. It seems like it makes things more usable to me and like it's probably worth attempting to figure out with the new autocomplete, but I wanted to open this and get some opinions flowing.