wintercms / wintercms/winter

Empty section remains visible when all inner fields are hidden via triggers

Open
#1,392 1 comment 0 reactions 0 assignees View on GitHub

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
  1. 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
  1. Set auth_type = saml, section and fields appear correctly
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.