Windows: Fix context menu when spellchecker is off (#3996)
This commit is contained in:
parent
6e4dc2a117
commit
fa052f1486
1 changed files with 7 additions and 2 deletions
|
@ -145,10 +145,15 @@ window.enableSpellCheck = () => {
|
||||||
window.removeEventListener('contextmenu', defaultContextMenuHandler);
|
window.removeEventListener('contextmenu', defaultContextMenuHandler);
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultContextMenuHandler = () => {
|
const defaultContextMenuHandler = e => {
|
||||||
|
// Only show the context menu in text editors.
|
||||||
|
if (!e.target.closest('textarea, input, [contenteditable="true"]')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const menu = buildEditorContextMenu({});
|
const menu = buildEditorContextMenu({});
|
||||||
|
|
||||||
// @see js/spell_check.js:183
|
// @see js/spell_check.js:177
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
menu.popup(remote.getCurrentWindow());
|
menu.popup(remote.getCurrentWindow());
|
||||||
}, 30);
|
}, 30);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue