dmn-js icon indicating copy to clipboard operation
dmn-js copied to clipboard

Cmd/Ctrl + Z closes the context menu when triggered inside input

Open barmac opened this issue 6 years ago • 2 comments

undo

Describe the Bug

Pressing the undo shortcut causes the context menu to close instead of undo the changes within the active input.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Type inside an input.
  2. Try to undo the action.

Expected Behavior

Context menu remains closed and the input action is undone.

Environment

Please complete the following information:

  • Browser: Chrome 77
  • OS: MacOS
  • Library version: both 6 and 7

barmac avatar Oct 23 '19 15:10 barmac

@nikku @barmac can you help me out in resolving this? I want to contribute, but haven't got any idea to tackle this. Thanks.

avats-dev avatar Oct 04 '20 12:10 avats-dev

Sure. This issue is actually pretty straightforward. The problem is within ContextMenuBehavior. It lacks a check whether the active element is one of inputs. Consider not only input selector, but also elements with contenteditable=true.

Don't forget to add tests! :)

Have a look at contributing guidlines (i.a. commit guidlines) so that your PR can be merged quickly.

Good luck!

barmac avatar Oct 05 '20 05:10 barmac