I was evaluating this for a project on a vanilla D8 install and noticed that choosing other doesn't trigger the conditional field to show unless you click the dropdown a second time. If it is a multi-value field, you also can click "Add Another Item" to get the field to show. Both conditions took me a bit of futzing to figure out, so I'd expect this is not normal behavior.

Comments

kthull created an issue. See original summary.

mradcliffe’s picture

Thanks for the report! That's odd. I wonder if there's a javascript regression somewhere.

This probably will motivate me more to figure out how to get Nightwatch tests to work.

mradcliffe’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, I was not able to reproduce this locally on Firefox. I tried using both the Seven administration theme and in Bartik.

https://imgur.com/a/oeFjjwC

Can you provide some more details about how you were configuring a select other field and form display? Or maybe the browser being used?

It's possible there's another module that is altering the form or structure or maybe I'm missing some JavaScript errors in Chromium, Edge or Safari.

kthull’s picture

Interesting...I only tested this in Chrome, but I did reproduce on a clean simplytest install with just Drupal core and this module.

As far as setup, I have done both as text list and taxonomy term reference, unlimited values, with "Select other list" as the field formatter in the form display.

mradcliffe’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

I was able to reproduce locally in both Chrome and Safari. No JavaScript errors unfortunately, which means something is fundamentally different between Gecko and Webkit.

Dang. I probably caused the regression at some point.

mradcliffe’s picture

Oh, I know what the issue is after reviewing my old Drupal 7 code. At some point, I needed to fix Internet Explorer use back then and had a condition to switch between change and click. I probably tested in Firefox in the last several years and found that click worked fine and then removed the change as JQuery removed the browser detection so I couldn't detect whether or not to use click/change anymore.

This is probably the issue.

mradcliffe’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

This is a backport of the fix from 7.x-1.x. I gave up on getting a working Nightwatch environment or getting Nightwatch tests to run on Drupal CI for now so this can only be tested manually.

kthull’s picture

The patch did the trick for me in Chrome!

  • mradcliffe committed 1863da6 on 8.x-1.x
    Issue #3067533 by mradcliffe, kthull: Fixes conditional field not...
mradcliffe’s picture

Status: Needs review » Fixed

Thank you for testing. I appreciate it.

mradcliffe’s picture

Status: Fixed » Closed (fixed)

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