Prevent browser/system shortcuts from triggering when applying editor style from shortcut (#32)

This commit is contained in:
David Sevilla Martin 2021-09-20 18:06:47 -04:00 committed by GitHub
parent 153138c770
commit 8111b5a56c

View File

@ -41,6 +41,7 @@ const applyStyle = (id) => {
function makeShortcut(id, key) {
return function (e) {
if (e.key === key && (e.metaKey && modifierKey === '⌘' || e.ctrlKey && modifierKey === 'ctrl')) {
e.preventDefault();
applyStyle(id);
}
}