winter icon indicating copy to clipboard operation
winter copied to clipboard

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

Open SushC-OSU opened this issue 5 months ago • 0 comments

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

SushC-OSU avatar Aug 05 '25 15:08 SushC-OSU