Skip to content

Default value for plugin fields  #437

Open
@ClaudiaPascualGea

Description

@ClaudiaPascualGea

Describe the bug
The default value for plugin fields, if not edited manually, is always an empty string "". This behavior occurs even if the plugin is expected to handle a different data type, such as numbers.

To Reproduce
Steps to reproduce the behavior:

  1. Create a component with a plugin field (e.g., a maxValue field).
  2. Add the component to a page without entering the plugin field editor.
  3. Save the page.
  4. Inspect the plugin field's value in the JSON output; it will show as an empty string "".

Expected behavior
It should be possible to define the expected data type for a plugin field (e.g., number, boolean, etc.) and set a default value accordingly. For example, if the field is meant to store a number, the default value should be 0 instead of an empty string.

Desktop (please complete the following information):

  • OS: iOS
  • Browser chrome

Additional context
This limitation makes it challenging to handle plugin fields that require a specific data type, as developers have to manually handle empty string values or implement workarounds in the plugin code. Allowing field data types to be explicitly defined would streamline workflows and ensure data consistency across components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions