Hi there!
I stumbled on this problem with conditional_fields, but the issue is in the core state.js. I just have 1 Select-Field, which allows multiple-values, and wanted to have a text-field to show up when an option is selected.
So the text-field should be hidden initially, since nothing is selected, not even "_none" (which is another issue I'm not going into here).
But the text-field is shown until I select something. If I select the one option which should show it, it stays there, otherwise it's gone. So that works fine, only the initial state is broken.
I had the issue with D7, but it holds true for D8 and D9. I tested it with D7, it worked there... so I assume it will work with D8 and D9.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 2791741-nr-bot.txt | 169 bytes | needs-review-queue-bot |
| #4 | core-form-states-initial-reevaluation-2791741-4.patch | 495 bytes | manishmore |
| core_form_states_initial_reevaluation.patch | 510 bytes | serkanb |
Comments
Comment #2
serkanb commentedComment #3
serkanb commentedChanging Version to D8 since D9 isn't really that interesting yet, therefore no one will get it I guess.
Comment #4
manishmore commentedas seen in an issue summary its has been asked to apply to
8.3.x-dev but it didn't so, updated same to the version of 8.3.x-dev core.
Comment #5
serkanb commentedYeah, my fault... didn't think it would be a problem to apply, since the code looked basically the same.
But now the patch also has a better (more valid/standard-conform) name :D thx.
Comment #10
alfazaz commentedThere should also be a patch for D7... When I make the same change as proposed for D8 in D7, it solves for me the #2273893 issue (Conditional Fields : Dependents appear on page load when they should be hidden). :-(
Comment #13
djdevinI confirmed this is still a bug.
Related patch for D7: #2798885: FAPI states: fields aren't hidden initally when depending on multi-value selection
Comment #20
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.