Use MouseEvent instead of KeyboardEvent in WithShortcut

* otherwise the disabled button will allow it to pass through
This commit is contained in:
Henrik Giesel 2021-05-07 14:41:31 +02:00
parent 9e747a5744
commit 6081a02558

View file

@ -19,7 +19,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const mounted: HTMLButtonElement = detail.button;
deregister = registerShortcut(
(event: KeyboardEvent) => {
mounted.dispatchEvent(new KeyboardEvent("click", event));
mounted.dispatchEvent(new MouseEvent("click", event));
event.preventDefault();
},
shortcut,