cms
cms copied to clipboard
[4.x]: Conditional fields' visibility not getting updated when in preview mode
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
- Add a
field condition
. Let's say have atext field
that should be visible when alightswitch field
is activated. - Open an entry with those fields and enter
preview mode
. - 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
This is a known issue, but not one we can fix immediately, unfortunately. Most likely will have to wait until Craft 5.
Ok, no big deal. Good to know it's on your radar!
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.
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
.