fix(@vben-core/form-ui): fix the issue of Textarea not being able to wrap lines in the form (#4691)

pull/48/MERGE
Svend 2024-10-20 21:07:34 +08:00 committed by GitHub
parent 234544c40d
commit 646598afba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -39,7 +39,14 @@ const handleUpdateCollapsed = (value: boolean) => {
props.formApi?.setState({ collapsed: !!value });
};
function handleKeyDownEnter() {
function handleKeyDownEnter(event: KeyboardEvent) {
// textarea
// textarea
if (event.target instanceof HTMLTextAreaElement) {
return;
}
event.preventDefault();
if (!state.value.submitOnEnter || !formActionsRef.value) {
return;
}
@ -49,7 +56,7 @@ function handleKeyDownEnter() {
<template>
<Form
@keydown.enter.prevent="handleKeyDownEnter"
@keydown.enter="handleKeyDownEnter"
v-bind="forward"
:collapsed="state.collapsed"
:component-bind-event-map="COMPONENT_BIND_EVENT_MAP"