- Issue created by @maxime-adagp
- Status changed to Needs review
over 1 year ago 9:11pm 22 August 2023 - last update
over 1 year ago 537 pass - ๐จ๐ดColombia Ozle Bogotรก
Hey @maxime-adagp,
Seems more like a problem with drupal.state library, in some cases the values โโof empty states appear as null and not booleans, so I created a patch from webform v6.1.x to make sure that the expected value is returned.
- ๐ฎ๐ณIndia kasli_harshit
applied the #2patch , changes working as expected now ( Attcahed the snapshot for the same) the display_name_ifalias field is working as expected when the married name field is empty.
- Status changed to Postponed: needs info
over 1 year ago 3:41pm 13 September 2023 - ๐บ๐ธUnited States jrockowitz Brooklyn, NY
The example is so complex I can't determine what is going on. Please provide a simplified example. See attached for my attempt at a simplified example.
- Status changed to RTBC
over 1 year ago 9:26am 14 September 2023 - ๐ซ๐ทFrance maxime-adagp Paris, France ๐ซ๐ท
Sorry if the example was too complex. I wanted to show my complete use case so that someone could point out whether there was a more idiomatic way of doing what I was trying to do (I was thinking variants but in the end it didn't work quite right).
Attached is a more generic version, which I hope is simpler to understand.
The crux of my issue is the fact that the state of a "pristine" text field -- that is to say, a text field that has not received input -- is
filled
. This should not be the case, because the text field is obviously empty at that point.This behavior is showcased in this new screenshot from the simplified version :
The patch provided in #2 does seem to solve my issue, so I'll mark this RTBC.
- Status changed to Needs review
over 1 year ago 1:43pm 14 September 2023 - ๐บ๐ธUnited States jrockowitz Brooklyn, NY
The patch might solve your problem but it is not clear if won't cause regressions.
- ๐ฎ๐ณIndia nikhil_110
#2 Patch applied, changes working as expected. I checked it in 4 steps which are as follows.
- The text field value will be filled and the check box will also be checked.
- The text field value will be empty and the check box will be checked.
- The text field value will be filled and the check box will be unchecked.
- Both fields will be empty and checked
All test scenarios are working fine, I have also added screenshots, please check.
- ๐บ๐ธUnited States jrockowitz Brooklyn, NY
I can replicate the issue with your example.
The patch seems like a workaround to a core issue that should be addressed directly in states.js.
For example, the patch changes code that we meant to be a work-around for IE11, which is no longer supported.
- ๐บ๐ธUnited States jrockowitz Brooklyn, NY
We should explore removing the IE11 workaround.
@see https://git.drupalcode.org/project/webform/-/blob/6.3.x/js/webform.state...