Browser's undo state causes weird things with our undo history

Created on 21 February 2025, 16 days ago

Overview

If the user has focus in an <input/> and presses cmd+z, the brower/os's undo is used, rather than our Redux based history state.

Steps to reproduce

  1. Click into a field in the right sidebar
  2. Type into the field
  3. Without clicking out of the field, press cmd+z
  4. The values in the input correct undo, however, the redo button remains in 'disabled' state because we have not actually stepped back in the Redux history.

In fact, as far as Redux is concerned, the change to the input value has actually created a new history state containing the change, so pressing undo in our UI now undoes the undo the user did when they were focused in the field!  

Proposed resolution

It leads me to question about other scenarios e.g. when a user's focus is inside a modal dialog we should not allow undo/redo to happen. Or what happens once we have CKeditor fields.

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

🇬🇧United Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024