Support Ctrl + Enter for non-Mac (#544)

zio/stable
Ollie Hsieh 2023-04-27 07:31:14 -07:00 committed by GitHub
parent 996dba7595
commit 62b07f93fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ export const TextInput = React.forwardRef(
getImageFromUri(items, onPhotoPasted) getImageFromUri(items, onPhotoPasted)
}, },
handleKeyDown: (_, event) => { handleKeyDown: (_, event) => {
if (event.metaKey && event.code === 'Enter') { if ((event.metaKey || event.ctrlKey) && event.code === 'Enter') {
// Workaround relying on previous state from `setRichText` to // Workaround relying on previous state from `setRichText` to
// get the updated text content during editor initialization // get the updated text content during editor initialization
setRichText((state: RichText) => { setRichText((state: RichText) => {