Skip to content

Add create_new_text and no_results_text, and announce the create row of searchable selects - #1700

Merged
lovasoa merged 6 commits into
sqlpage:mainfrom
mkerz-masfg:select-create-text
Nov 30, 2026
Merged

lovasoa merged 6 commits into
sqlpage:mainfrom
mkerz-masfg:select-create-text

Conversation

@mkerz-masfg

@mkerz-masfg mkerz-masfg commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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).

  • New optional create_new_text (default "Add") and no_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.
  • The create row gets role="option" and an id, so aria-activedescendant names it.

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

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 lovasoa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@lovasoa
lovasoa added this pull request to the merge queue Nov 30, 2026
Merged via the queue into sqlpage:main with commit 035fa61 Nov 30, 2026
57 checks passed
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.

Searchable select: customizable "Add …" and "No results found" texts, and announce the create row to screen readers

2 participants