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

This commit is contained in:
zhengliming
2023-12-19 14:07:42 +08:00
parent 60c496e6ff
commit 344f681181

View File

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