display_if incorrectly hide siblings when matching their display-src
values
#873
Labels
bug
Something isn't working
good first issue
Good for newcomers
javascript
Requires understanding JavaScript
scope:display-if
ux
Designing and implementing user experience improvements
Description of the bug
When trying to trigger the show and/or hide fields,
display_if
matches the partial field name of a sibling field instead of performing an exact match.If you happen to have a
display_if
logic that share a field name, fields with a partial match ends up getting hidden.The source of the issue seems to be the use of
.match
here, since it is not an exact name match but a partial one (it matches a string based of the field name instead of matching the string with the field name):wordpress-fieldmanager/js/fieldmanager.js
Line 299 in 584979f
Steps To Reproduce
Here is an example you can use to replicate this issue:
CleanShot.2024-07-23.at.23.51.29.mp4
Additional Information
I'm working on the assumption that
.match
should match the field name provided indisplay-src
, but it is possible there is feature that relies on a loose match.So this change might require a bit more testing to avoid regressions.
The text was updated successfully, but these errors were encountered: