Problem/Motivation

The fix for the issue reported in #2705891: Client-side-validation broken with Chosen seems to not work (anymore), I'm still getting the following error in the Chrome console:
An invalid form control with name='field_test[]' is not focusable.

Steps to reproduce

  1. Add a required field to an entity type
  2. Create a new entity
  3. Run the following in the browser console in case Drupal sets a default value: document.getElementById('xxxx').value = ''
  4. Submit the form

Proposed resolution

The last suggested fix in the upstream issue does seem to fix the issue.

Issue fork chosen-3409490

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Status: Active » Needs review

Committed a fix, tested with the latest Chrome and Firefox.

nagy.balint’s picture

Hi!

Are you using the JJJ fork of chosen?

I see this commit https://github.com/JJJ/chosen/pull/15 but then I guess that was not enough to fix the issue?

nagy.balint’s picture

Status: Needs review » Postponed (maintainer needs more info)
artis.bajars’s picture

This issue also exists in the 5.x branch of Chosen that's using noli42/chosen library. The fix suggested here does not apply anymore. Should this be addressed in the module or upstream?

artis.bajars’s picture

Status: Postponed (maintainer needs more info) » Active
nagy.balint’s picture

If possible it should be fixed in the library
https://github.com/noli42/chosen

nagy.balint’s picture

Version: 4.0.x-dev » 5.0.x-dev

Lets hope that the 3.0.4 version of the lib fixes the issue without side effects.

  • nagy.balint committed 71a286f6 on 5.0.x
    feat: #3409490 Client-side-validation broken with Chosen
    
    By:...
nagy.balint’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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