Empty section remains visible when all inner fields are hidden via triggers
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.5k
- Forks
- 246
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 7
Description
Winter CMS Build
1.2
PHP Version
8.1
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
In backend forms, if a section has fields that are conditionally shown using YAML trigger, the section may remain expanded with no content when all its fields are hidden. This creates an empty panel section UI when switching away from the selected option that originally made the section visible.
Steps to replicate
- Create a backend form with:
- A radio field (e.g., auth_type) to control the display
- A section (e.g., saml_advanced) with a trigger to show it when auth_type = saml
- Fields inside the section that also have their own trigger based on auth_type
- Set auth_type = saml, section and fields appear correctly
- Switch auth_type to something else, section header disappears, but an empty expanded remains
Expected Behavior:
The section should fully collapse (and hide) when all of its child fields are hidden.
Actual Behavior:
The section’s container remains visible and expanded, despite no visible fields inside it, resulting in a blank section with empty space.
Why This Happens:
- Section has its own trigger on auth_type.
- Each field inside the section also has independent triggers.
- So even if the section is hidden via filterFields() or YAML trigger, the child fields' triggers override or conflict.
- This causes the section content to remain expanded even when empty.
https://github.com/user-attachments/assets/870d27b0-cf3c-43d3-879c-aff7b8a9da1b
Workaround
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the radio field, section, and child YAML triggers described above, then trace the form section and field handling around filterFields() and the panel-collapse element. Done means changing auth_type leaves no visible or expanded empty section when all child fields are hidden; verify both the reported sequence and the normal visible-section case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100