Skip to content

Repeater: confirm row removal with the editor's ConfirmDialog instead of window.confirm #132

Closed

Description

@Contributolo

Removing a repeater row asks for confirmation with the browser's own window.confirm() (src/blocks/components/fields/components/repeater.tsx, the blockstudio-repeater__remove control). Three things about that dialog:

  • It does not look like the editor. It is the plain browser dialog with the site URL as its title, while every other confirmation in the block editor (for example deleting a pattern or resetting styles) uses the ConfirmDialog from @wordpress/components.
  • It is modal for the whole tab. While it is open nothing else on the page runs, which also stops browser automation and end to end tests: a Playwright or Chrome DevTools session has to register a dialog handler before every row removal, otherwise the next command times out.
  • The texts are translatable already (textRemove, and textRemove: false skips the question), so only the presentation is the issue.

Suggestion: use __experimentalConfirmDialog from @wordpress/components with the same text, confirmButtonText "Delete" and the existing textRemove behavior. An alternative without any question would be to remove the row immediately and offer undo in a snackbar, the way the block editor handles removed blocks, but that is a bigger change.

If one of these fits, I am happy to send a pull request. It would touch the same row controls as #126 (accessible names for the row buttons), so I would base it on that branch or wait until #126 is merged, whichever you prefer.

Found while testing our blocks in the editor with Blockstudio 7.7.3.

Activity

  1. dnnsjsk commented on Oct 16, 2026

    @dnnsjsk
    Contributor

    Implemented on the unreleased 7.7.4 preparation branch in d1d9ef8. Repeater removal now uses WordPress’s ConfirmDialog with a Delete action, retaining custom textRemove questions and textRemove: false for immediate removal. Cancel/Escape preserve the row and restore focus. Nested dialog keyboard events cannot reorder parent rows. Added browser regression coverage for default/boolean/empty/custom questions, cancellation, keyboard confirmation, nested isolation, minimum rows and saved deletions, and updated docs/schema/changelog. Local PHP/client/static checks pass; full [all] CI is being run. Leaving this issue open until the release is merged and published.

  2. dnnsjsk commented on Oct 17, 2026

    @dnnsjsk
    Contributor

    Released in Blockstudio 7.7.4, commit e1d38df.

    Repeater removal now uses the editor's confirmation dialog with a Delete button. Custom text and textRemove: false are preserved. Browser regression tests cover Cancel/Escape focus return, keyboard activation, nested rows, minimum-row restrictions and saved deletion. Full CI and Distribution passed on the release commit.

    Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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