Skip to content

Current repeater item is lost when adding a new item in PrettyBlocks #319

@Daaaaad

Description

@Daaaaad

When editing a repeater field in PrettyBlocks (e.g. a list of ingredients), any unsaved change in the currently selected sub-item is discarded as soon as we add a new element to the repeater. The module pushes a fresh empty item to the database, reloads the whole state, and overwrites the local changes of the item we were editing.

Steps to Reproduce

  • Go to Back-office → PrettyBlocks → select a zone containing a repeater block.
  • Click on an existing item in the repeater list to edit it.
  • Change a value, e.g. rename an ingredient. Do not click “Save”.
  • Click “Add item” (➕) to append a new entry to the list.
  • Observe that the name you just edited reverts to its previous value.

Expected Behavior

The current item should be auto-saved (or at least kept in memory) before inserting a new empty item, so that edits are not lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions