mirror of
https://github.com/flarum/core.git
synced 2025-08-07 17:07:19 +02:00
Prevent browser/system shortcuts from triggering when applying editor style from shortcut (#32)
This commit is contained in:
committed by
GitHub
parent
153138c770
commit
8111b5a56c
@@ -41,6 +41,7 @@ const applyStyle = (id) => {
|
|||||||
function makeShortcut(id, key) {
|
function makeShortcut(id, key) {
|
||||||
return function (e) {
|
return function (e) {
|
||||||
if (e.key === key && (e.metaKey && modifierKey === '⌘' || e.ctrlKey && modifierKey === 'ctrl')) {
|
if (e.key === key && (e.metaKey && modifierKey === '⌘' || e.ctrlKey && modifierKey === 'ctrl')) {
|
||||||
|
e.preventDefault();
|
||||||
applyStyle(id);
|
applyStyle(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user