fix(dashboard): Allow using enter key to create newline in Textarea (#9913)

* fix(dashboard):Allow using enter key to create newline in Textarea

* update scheam file
This commit is contained in:
Kasper Fabricius Kristensen
2024-11-05 08:54:28 +01:00
committed by GitHub
parent c0368cca28
commit d19d7a66ff
5 changed files with 45 additions and 8 deletions

View File

@@ -14,6 +14,13 @@ export const KeyboundForm = React.forwardRef<
const handleKeyDown = (event: React.KeyboardEvent<HTMLFormElement>) => {
if (event.key === "Enter") {
if (
event.target instanceof HTMLTextAreaElement &&
!(event.metaKey || event.ctrlKey)
) {
return
}
event.preventDefault()
if (event.metaKey || event.ctrlKey) {