mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +08:00
Disable cut/copy contextual menu items in password fields
This commit is contained in:
parent
1d923cf406
commit
63286cc7e2
1 changed files with 11 additions and 2 deletions
|
@ -301,6 +301,13 @@ export default class WindowEventHandler {
|
|||
if (!textualInputs.includes(event.target.type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const supportsCutCopy = event.target.type !== 'password';
|
||||
if (!supportsCutCopy) {
|
||||
this.openSpellingMenuFor('', false, {});
|
||||
return;
|
||||
}
|
||||
|
||||
const hasSelectedText = event.target.selectionStart !== event.target.selectionEnd;
|
||||
let wordStart = null;
|
||||
let wordEnd = null;
|
||||
|
@ -333,8 +340,10 @@ export default class WindowEventHandler {
|
|||
const { Menu, MenuItem } = remote;
|
||||
const menu = new Menu();
|
||||
|
||||
Spellchecker = Spellchecker || require('./spellchecker').default;
|
||||
Spellchecker.appendSpellingItemsToMenu({ menu, word, onCorrect });
|
||||
if (word) {
|
||||
Spellchecker = Spellchecker || require('./spellchecker').default;
|
||||
Spellchecker.appendSpellingItemsToMenu({ menu, word, onCorrect });
|
||||
}
|
||||
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
|
|
Loading…
Reference in a new issue