1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Resolves #4766: ENTER key no longer submits dialogs when a textarea is focused. (#4777)

This commit is contained in:
Ahmad Mamdouh 2021-04-08 11:31:26 +02:00 committed by GitHub
parent 9642f5f715
commit 1354c247b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -34,11 +34,14 @@ joplin.plugins.register({
Name: <input type="text" name="name"/>
<br/>
Email: <input type="text" name="email"/>
<br/>
Description: <textarea name="desc"></textarea>
</form>
`);
const result3 = await dialogs.open(handle3);
console.info('Got result: ' + JSON.stringify(result3));
},
});

View File

@ -15,7 +15,13 @@ export default function(frameWindow: any, onSubmit: Function, onDismiss: Functio
}
if (event.key === 'Enter') {
if (onSubmit) onSubmit();
//
// Disable enter key from submitting when a text area is in focus!
// https://github.com/laurent22/joplin/issues/4766
//
if (frameWindow.document.activeElement.tagName != 'TEXTAREA') {
if (onSubmit) onSubmit();
}
}
}