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

This commit is contained in:
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

View file

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