Repository navigation
Add create_new_text and no_results_text, and announce the create row of searchable selects - #1700
Merged
Merged
Conversation
Pass render.option_create and render.no_results to Tom Select, with the texts from data-create_new_text and data no_results_text and the current English texts as default. The create row also gets role="option" and an id: Tom Select gives both only to regular options, so screen readers did not announce the create row when it was the active option.
lovasoa
approved these changes
Nov 30, 2026
lovasoa
left a comment
Collaborator
There was a problem hiding this comment.
Thank you ! I'll merge it so that it works on our side immediately, but I encourage you to open a PR in Tom Select too so that more people benefit from the accessibility fix in particular.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dropdown of a searchable select showed the fixed English texts "Add …" and "No results found", and Tom Select gave role="option" and an id only to regular options, so screen readers did not announce the create row when it was the active option (no aria-activedescendant).
create_new_text(default "Add") andno_results_text(default "No results found") properties on select fields, passed to Tom Select through render.option_create and render.no_results; pages without them keep the same texts.Added both documentation rows, a CHANGELOG entry and a Playwright fixture (tests/end-to-end/fixtures/select-create-text/) with a translated and a default field. I could not build SQLPage locally, so I checked the fixture's steps against the official v0.48.0 binary with an overridden form.handlebars that loads a tomselect.js built from this branch: they fail on v0.48.0 and pass with the change. npm test (Biome, TypeScript, JS tests) and npm run site:test pass.
Fixes #1699