Problem/Motivation

For anonymous users, the clearValueAndRequired() function of the Webform states library is executed before the ajax events are bound. For authenticated users everything works as expected.

Steps to reproduce

  1. Create a form with an ajax-enabled element
  2. Set a default value on the element
  3. Hide that element using states
  4. Make sure "Clear value(s) when hidden" is checked

For authenticated users everything is ok.
For anonymous users the field is cleared before the ajax event is bound, so it's not triggered when the field is cleared by the states library.

CommentFileSizeAuthor
#4 webform.webform.issue_3340613.yml5.15 KBjrockowitz

Comments

Matthijs created an issue. See original summary.

jrockowitz’s picture

Title: States library clears input to early » [#States API] States library clears input to early
jrockowitz’s picture

Version: 6.2.x-dev » 6.3.x-dev
jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new5.15 KB

I am not able to replicate this issue using the attached webform

liam morland’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Needs issue summary update

If you can provide a Webform that reproduces the issue, please re-open.

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.