Problem/Motivation

Both the Chosen and Select2 javascript libraries have known accessibility issues. The Webform module and the Drupal community needs to implement a better UX for tagging and multiple select elements.

@see #2346973: Improve usability, accessibility, and scalability of long select lists

Proposed resolution

Add optional support for Choices.js to the Webform module.

Choices.js is a lightweight, configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency and better accessibility.

Remaining tasks

Tasks should mirror #2871606: Add (optional) support for Chosen

  • Add choices.js to webform.libraries.yml
  • Add #choices property support for select elements.
  • Create webform.element.choices.js
  • Add choices.js test webform
  • Add examples

Notes

  • Select2 will be recommended default library.
  • Choices integration will be very basic.

User interface changes

Choices.js will now be added to libraries.

API changes

None

Data model changes

N/A

Release notes snippet

TDB

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes

  • jrockowitz committed e6bb2fb on 3045944-choices
    Issue #3045944: Add optional support for Choices.js to the Webform...

  • jrockowitz committed 4d3eb8a on 3045944-choices
    Issue #3045944 by jrockowitz: Add optional support for Choices.js to the...
jrockowitz’s picture

Status: Active » Needs review
FileSize
29.22 KB

Status: Needs review » Needs work

The last submitted patch, 5: 3045944-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • jrockowitz committed 713345c on 3045944-choices
    Issue #3045944 by jrockowitz: Add optional support for Choices.js to the...
jrockowitz’s picture

Status: Needs work » Needs review
FileSize
37.37 KB
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 49595d3 on 8.x-5.x
    Issue #3045944 by jrockowitz: Add optional support for Choices.js to the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.