WordPress / playground-tools

GNU General Public License v2.0
138 stars 39 forks source link

Playground block: Prevent the CodeMirror keyboard shortcuts from leaking to the block editor #281

Closed adamziel closed 4 months ago

adamziel commented 4 months ago

What?

Prevents keyboard events from leaking from the code editor to the block editor. It solves the problem of, e.g., undoing block changes when pressing cmd+z with the intention of undoing code changes.

Testing Instructions

  1. Add a few paragraph blocks
  2. Add the Playground block
  3. Enable the code editor
  4. Start typing
  5. Press cmd+s, the code should be re-run
  6. Press cmd+z a few times, it should only undo the changes inside the code editor but not in the block editor