undo management: separate blocky and browser #1915
Labels
component: browser
component: events
help wanted
External contributions actively solicited
issue: bug
Describes why the code or behaviour is wrong
size: small
Bugs that can be picked up and completed in 1-3 days
Milestone
There is a concurrency between Blockly undo management and browser undo management.
This affects safari and google chrome but does not affect firefox at least on OS X.
Take the fixed blockly demo at
blockly/demos/fixed/index.html
and add atextarea
. If you perform changes in both the text area and the workspace, undo/redo with key shortcut merges Blockly undo management and browser undo management.Here are the steps:
Problem: both the text area and the workspace are reverted during the same operation.
Expected behaviour: when the workspace has the focus, the undo/redo actions should apply to the workspace only.
Ideally, when the workspace has the focus, the menu item undo/redo action of the browser should apply to the workspace only.
Newer repro steps (2023/11/21)
npm run start
to open the playground.To Fix
Edit the keyboard shortcuts for undo and redo to call
preventDefault
on the event they are passed. You will need to add an extra event parameter to thecallback
method. Check out the type definition for keyboard shortcuts.The text was updated successfully, but these errors were encountered: