ECA: Conditional fields - states do not change back if not applicable.

Created on 24 February 2025, 6 days ago

Problem/Motivation

Based on this 3486384 ✨ ECA Form: add basic states API support for fields Active it seems that ECA can finally handle conditional fields so possibly this module conditional_fields β†’ can be replaced with ECA.

However it seems it does not work as it should. At least for my case. It works as expected for the default state, however once changed and reverted back - it won't trigger the state change.

Uploading attached model + video to better understand the problem.

In my example case I need one field disabled if another one has value "open". It works, but if I change value to "closed" it became enabled which is perfect, but once i revert back to "open" and even ajax handler is enabled it still shows field enabled, but it should be disabled again.

I have tried different scenarios like visible,required and empty/filled/value etc, but still the same result. It works only once.
Note: If I disable the default value which is "open" and keep "none" value - in this case it never works.
Am I missing anything?

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    That model is doing far too much. You only need the build form event and the "Add State" action without any condition:

    All the logic is then applied client-side. Just tested it and that works like a charme.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Wau such a simple solution and I have spent hours with a complex one.

    Much appreciated.Another module can be replaced with ECA now.

Production build 0.71.5 2024