Windows: Fix context menu when spellchecker is off (#3996)

This commit is contained in:
blckfalcon 2020-03-02 22:30:56 -03:00 committed by GitHub
parent 6e4dc2a117
commit fa052f1486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,10 +145,15 @@ window.enableSpellCheck = () => {
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({});
// @see js/spell_check.js:183
// @see js/spell_check.js:177
setTimeout(() => {
menu.popup(remote.getCurrentWindow());
}, 30);