Automattic / Automattic/isolated-block-editor

`onLoad` content is added to undo stack

Open
#89 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
CSS
Stars
409
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Despite the intent of this code to prevent initial `onLoad` content from being added to the undo stack, it does get added and is undoable:

https://github.com/Automattic/isolated-block-editor/blob/82b69eda507554c76b4afecc1f75987955c22e36/src/components/block-editor-contents/index.js#L75-L86

(This behavior was fixed for undo in collab mode #68, but is not yet fixed for the non-collab case.)

## Steps to reproduce

For convenience, here's a branch with a Storybook story for `onLoad` and a failing UI integration test: https://github.com/Automattic/isolated-block-editor/tree/test/onload-undo

1. Load an iso-editor with some `onLoad` content.
2. Once the initial content loads, the Undo button is active.
3. When you trigger an undo, you can wipe out the initial content.

### Expected behavior

The initial `onLoad` content is not undoable.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/components/block-editor-contents/index.js lines 75-86 and use the test/onload-undo branch's Storybook story and failing UI integration test to reproduce the behavior. Done means initial onLoad content does not activate the Undo button and cannot be removed by undo.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, storybook
Domain
frontend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.