cms icon indicating copy to clipboard operation
cms copied to clipboard

[6.x] Revealer field conditions not working with "Toggle" UI mode

Open o1y opened this issue 7 months ago • 2 comments

Bug description

When using a Revealer field with the UI mode set to Toggle, the field conditions are not applied. Fields that should be displayed based on the Revealer’s state remain hidden. No issues with the Button mode.

Image

How to reproduce

  1. Create a Revealer field.
  2. Set its UI mode to Toggle.
  3. Add another field with a condition depending on the Revealer’s state.
  4. Switch the Revealer toggle.

Here's my Blueprint:

title: Page
tabs:
  main:
    display: Main
    sections:
      -
        display: 'New Section'
        fields:
          -
            handle: title
            field:
              type: text
              required: true
          -
            handle: replicator
            field:
              type: replicator
              display: Replicator
              sets:
                new_set_group:
                  display: 'New Set Group'
                  sets:
                    new_set:
                      display: 'New Set'
                      fields:
                        -
                          handle: revealer
                          field:
                            type: revealer
                            display: Revealer
                        -
                          handle: text_field
                          field:
                            type: text
                            display: 'Text Field'
                            if:
                              revealer: 'equals true'
                        -
                          handle: textarea_field
                          field:
                            type: textarea
                            display: 'Textarea Field'
                            if:
                              revealer: 'equals true'
      -
        display: 'New Section'
        fields:
          -
            handle: another_revealer
            field:
              mode: toggle
              type: revealer
              display: 'Another Revealer'
          -
            handle: date_field
            field:
              type: date
              display: 'Date Field'
              if:
                another_revealer: 'equals true'
  sidebar:
    display: Sidebar
    sections:
      -
        fields:
          -
            handle: slug
            field:
              type: slug
              localizable: true
              validate: 'max:200'

Logs


Environment

Version: 6.0.0-alpha.1

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

o1y avatar Aug 22 '25 15:08 o1y

This doesn't seem completely fixed on alpha 3. I notice revealers don't work still. Perhaps it's due to nesting? I think I have replicator > replicator > grid.

You can see it in the Peak install when you go to the homepage. Open up the page builder, hit cards. Check a card and then try to alter the button properties.

robdekort avatar Aug 27 '25 09:08 robdekort

~~Just here to inform this would cause an issue on all Peak sites as they use this pattern in the button fieldset. So this could potentially be a big issue for folks.~~

Nevermind, I had already commented above I see now :-)

robdekort avatar Nov 18 '25 15:11 robdekort