cms icon indicating copy to clipboard operation
cms copied to clipboard

[4.x]: Conditional fields' visibility not getting updated when in preview mode

Open thupsi opened this issue 2 years ago • 4 comments

What happened?

Description

When in preview mode, changing a field that controls the visibility of another field, does not have the expected result of toggling the second field's visibility.

Steps to reproduce

  1. Add a field condition. Let's say have a text field that should be visible when a lightswitch field is activated.
  2. Open an entry with those fields and enter preview mode.
  3. Toggle the lightswitch field

Expected behavior

The text field should be visible

Actual behavior

The text field remains hidden (It becomes visible though when the user exits preview mode)

Craft CMS version

Craft Pro 4.0.4

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

thupsi avatar Jun 14 '22 07:06 thupsi

This is a known issue, but not one we can fix immediately, unfortunately. Most likely will have to wait until Craft 5.

brandonkelly avatar Jun 14 '22 12:06 brandonkelly

Ok, no big deal. Good to know it's on your radar!

thupsi avatar Jun 15 '22 16:06 thupsi

I just noticed this issue in a big way on a very condition-heavy section. I don't suppose it would be easy to have the live preview version of the form show all fields regardless of conditions? This would at least mean that no fields are inaccessible in live preview.

ItagMichael avatar May 19 '23 06:05 ItagMichael

Unfortunately no, as any fields that are “hidden” due to conditionals are not present in the form at all – not simply hidden via display: none.

brandonkelly avatar May 23 '23 00:05 brandonkelly