I'm using Profile2 7.x-1.3 module and have some text fields. While I'm setting, the default value has suffered some changes (see picture1).

When a user will include a value in the field, it appears in error, with a small width, and with great height (see picture2).

The configuration of the chosen module is only for "select".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kobb’s picture

I can confirm this problem. My only fix is to edit the field settings and change:
Apply Chosen to the select fields in this widget? -> No Preference.

EricRondo’s picture

Same problem for me, #1 solved it but very strange issue...

jbrauer’s picture

Specifically in

/**
 * Helper function to update element recursively.
 */
function chosen_ajax_field_widget_apply_recursive(&$element, $settings) {
  if (isset($element['#chosen'])) {
    if (isset($element['#type']) && $element['#type'] == 'textfield') {

The issue here is that the $element['#chosen'] == false which evaluates to true ... then #chosen_ajax gets added to the field and later in chosen_ajax_theme_textfield() the presence of #chosen_ajax, even in the face of #chosen = false causes the textfield to be made into a select.

The simple fix is to change:

if (isset($element['#chosen'])) {

to:

if (!empty($element['#chosen'])) {

jbrauer’s picture

Project: Chosen » Chosen Ajax
Version: 7.x-2.0-beta4 » 7.x-1.0-beta2
jbrauer’s picture

This makes this a duplicate of the fix in #2218863: Chosen Ajax ignores the value of "Apply Chosen to the following elements"

Given the implications of this issue it would be great to get a new tagged release but upgrading to -dev should resolve the issue.

vincentdemers’s picture

FileSize
13.47 KB
677 bytes

I've had that same issue with 7.x-1.0-beta2+1-dev when using inline_entity_form to add a product_display using drupal commerce. It seems the chosen_ajax widget is applied to other textfields even tough there is no autocomplete_path set in the element.

I'm providing a patch for the fix that worked for me.

cheval’s picture

Patch above works.

cheval’s picture

Status: Active » Reviewed & tested by the community

Patch in #6 works here, thank you!
In case the autocomplete field doesn't change, double check the field settings if Chosen is applied to it.

  • dwebpoint committed 0424523 on 7.x-1.x
    Issue #2410453: Module chosen being applied in text fields
    
dwebpoint’s picture

Thanks all for pointing out the issue.
I've updated the dev branch to fix the issue.

dwebpoint’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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