[fix] 修复输入框为select的时候,点击事件失效问题

This commit is contained in:
zhengliming
2023-12-19 14:07:42 +08:00
parent 60c496e6ff
commit 344f681181
+42 -22
View File
@@ -33,28 +33,39 @@
@focus="onFocus" @focus="onFocus"
@confirm="onConfirm" @confirm="onConfirm"
/> />
<input <view v-else>
v-else
class="tn-input__input" <view
:type="type === 'password' ? 'text' : type" v-if="type === 'select'"
:style="[inputStyle]" class="tn-input__text"
:value="defaultValue" >
:password="type === 'password' && !showPassword" {{defaultValue}}
:placeholder="placeholder" </view>
:placeholderStyle="placeholderStyle"
:disabled="disabled || type === 'select'" <input
:maxlength="maxLength" v-else
:focus="focus" class="tn-input__input"
:confirmType="confirmType" :type="type === 'password' ? 'text' : type"
:selectionStart="elSelectionStart" :style="[inputStyle]"
:selectionEnd="elSelectionEnd" :value="defaultValue"
:cursorSpacing="cursorSpacing" :password="type === 'password' && !showPassword"
:showConfirmBar="showConfirmBar" :placeholder="placeholder"
@input="handleInput" :placeholderStyle="placeholderStyle"
@blur="handleBlur" :disabled="disabled || type === 'select'"
@focus="onFocus" :maxlength="maxLength"
@confirm="onConfirm" :focus="focus"
/> :confirmType="confirmType"
:selectionStart="elSelectionStart"
:selectionEnd="elSelectionEnd"
:cursorSpacing="cursorSpacing"
:showConfirmBar="showConfirmBar"
@input="handleInput"
@blur="handleBlur"
@focus="onFocus"
@confirm="onConfirm"
/>
</view>
<!-- 右边的icon --> <!-- 右边的icon -->
<view class="tn-input__right-icon tn-flex tn-flex-col-center"> <view class="tn-input__right-icon tn-flex tn-flex-col-center">
@@ -376,6 +387,15 @@
color: $tn-font-color; color: $tn-font-color;
flex: 1; flex: 1;
} }
&__text {
font-size: 28rpx;
color: $tn-font-color;
flex: 1;
min-width: 296rpx;
max-width: 100%;
text-overflow:clip;
}
&__textarea { &__textarea {
width: auto; width: auto;