Skip to content

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

@o1y

Description

@o1y

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions