fix(components): [message-box] textarea can not use multiline text (#6774)

fix: #6765
This commit is contained in:
Hefty 2022-03-23 18:15:10 +08:00 committed by GitHub
parent 35ad87ef0b
commit bbcd54ce7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@
:type="inputType"
:placeholder="inputPlaceholder"
:class="{ invalid: validateError }"
@keydown.prevent.enter="handleInputEnter"
@keydown.enter="handleInputEnter"
/>
<div
class="el-message-box__errormsg"
@ -363,8 +363,9 @@ export default defineComponent({
const overlayEvent = useSameTarget(handleWrapperClick)
const handleInputEnter = () => {
const handleInputEnter = (e: KeyboardEvent) => {
if (state.inputType !== 'textarea') {
e.preventDefault()
return handleAction('confirm')
}
}