Don't let Mockuper's shortcuts hijack undo and delete while typing in a field

Open Beginner friendly
#1,147 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@bfs2021 is already working on this.

Since Nov 2, 2026.

  • #1166 by @bfs2021 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Start in the global keydown handler in mockuper/js/modules/UIController.js (around lines 264-282), where Delete/Backspace already skip input and textarea targets. Add an isEditingText(target) helper using closest() for input, textarea, select and [contenteditable], then gate the delete, undo and redo branches on it. Make the Z and Y key checks case-insensitive with e.key.toLowerCase(). Done when Ctrl/Cmd+Z in a property field edits text, Ctrl/Cmd+Shift+Z redoes on the canvas, and Delete still removes the selected element when the canvas has focus.

Written by the indexing model from the issue text.

Description

2026-11 bug good first issue gsoc-2027 project: mockuper
Context

The global keydown handler in mockuper/js/modules/UIController.js (~lines 264-282) skips INPUT/TEXTAREA for Delete/Backspace, but not for Ctrl/Cmd+Z and Ctrl+Y / Ctrl+Shift+Z. Pressing Ctrl+Z while editing a property in the right panel calls preventDefault() and undoes a whole canvas change instead of the last text edit. The input check also misses SELECT and contentEditable elements.

What to do
  • Add a helper isEditingText(target) that returns true for input, textarea, select and [contenteditable] (use closest).
  • Skip all canvas shortcuts (delete, undo, redo) when it returns true.
  • Make the undo/redo key check case-insensitive (e.key.toLowerCase()), because with Shift held e.key is "Z", so Ctrl/Cmd+Shift+Z redo never fires today (only Ctrl+Y works).
Acceptance criteria
  • Ctrl/Cmd+Z inside a property input undoes text, not the canvas.
  • Ctrl/Cmd+Shift+Z redoes on the canvas when focus isn't in a field.
  • Delete/Backspace still removes the selected element when focus is on the canvas.
Files
  • mockuper/js/modules/UIController.js
Helpful links

Part of GSoC 2027 onboarding — see https://gsoc.alphaonelabs.com

Dominant language
HTML
Stars
66
Forks
181
Avg merge
2h 21m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from alphaonelabs/website

All issues in alphaonelabs/website

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.