8000 undo management: separate blocky and browser · Issue #1915 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
undo management: separate blocky and browser  #1915
Open
@jlaurens

Description

@jlaurens

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 a textarea. 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:

  1. load the modified page
  2. enter some text in the text area
  3. drag some block in the workspace
  4. trigger an undo event with the key shortcut

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)

  1. Run npm run start to open the playground.
  2. Type some text into the text field on the left.
  3. Drag a block into the workspace.
  4. Trigger an undo with a keyboard shortcut.
  5. Observe how the block is deleted and the text change is reverted. Expect the text to not be modified.

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 the callback method. Check out the type definition for keyboard shortcuts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: browsercomponent: eventshelp wantedExternal contributions actively solicitedissue: bugDescribes why the code or behaviour is wrongsize: smallBugs that can be picked up and completed in 1-3 days

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0