Announcement

Collapse
No announcement yet.

Initial Scheduling Toggle State in Flex Components

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Initial Scheduling Toggle State in Flex Components

    I'm building a custom flex component with scheduling fields using the can_disable group pattern, and I'm running into a persistent issue: toggles are defaulting to ON when new list items are created, rather than OFF.

    Here's the property structure I'm using:

    ```json
    {
    "code": "start_date",
    "prompt": "Not Visible Before",
    "type": "group",
    "can_disable": 1,
    "properties": [
    { "code": "start", "prompt": "Start Date/Time", "type": "datetime" }
    ]
    }
    ```

    I've tried several variations to get the toggle to default to OFF for new items:

    1. "settings": { "enabled": 0 } on the group - toggle still defaults ON
    2. "template": { "settings": { "enabled": 0 } } on the group - toggle still defaults ON
    3. No settings or template at all (matching the pattern in mmx-mega-menu) - toggle still defaults ON
    4. Nesting start/end inside a parent group without can_disable (caret-only collapsible) - child toggles still default ON

    The fields are inside a list_type: group list property. When a new list item is created in Page Builder, both the Not Visible Before and Not Visible After toggles are ON by default, which means all new items are immediately date-gated and invisible until toggles are manually turned off.

    For reference, I have another component on the same site that uses the identical pattern (can_disable: 1, no settings/template) and its scheduling toggles correctly default to OFF. The only structural difference I can identify is that in the other component the scheduling fields are at the top level of the list item, whereas in my component they are nested inside a group. Also, the component I'm having trouble with is global, the other one is not.

    Questions:
    1. Is there a correct way to specify can_disable defaults for new list items?
    2. Does nesting a can_disable group inside another group affect its default state?
    3. Is this a known issue?

    Running Miva 26.01.01.

    Thanks!
    Psydde Delicious
    Delicious Boutique & Corseterie
    Philadelphia, PA
    www.DeliciousBoutique.com
    www.DeliciousCorsets.com
Working...
X