Skip to content

Commit

Permalink
Extend basic spellcheck to textarea for new plaintext composer #52
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow authored and notpushkin committed Feb 26, 2020
1 parent 1c8e881 commit d53fb44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/window-event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export default class WindowEventHandler {
});

document.addEventListener('contextmenu', event => {
if ((event.target as HTMLElement).nodeName === 'INPUT') {
const nodeName = (event.target as HTMLElement).nodeName;
if (nodeName === 'INPUT' || nodeName === 'TEXTAREA') {
this.openContextualMenuForInput(event);
}
});
Expand Down Expand Up @@ -303,7 +304,7 @@ export default class WindowEventHandler {
event.preventDefault();

const textualInputs = ['text', 'password', 'email', 'number', 'range', 'search', 'tel', 'url'];
if (!textualInputs.includes(event.target.type)) {
if (event.target.nodeName === 'INPUT' && !textualInputs.includes(event.target.type)) {
return;
}

Expand Down

0 comments on commit d53fb44

Please sign in to comment.