1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

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);
}
}