Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 3cdc3dc

Browse files
committed
fix: Clearable disabled or readonly input
1 parent 8293bf5 commit 3cdc3dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Vue3DatePicker/components/DatepickerInput.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
><slot name="input-icon"></slot
1414
></span>
1515
<CalendarIcon v-if="!$slots['input-icon'] && !hideInputIcon" class="dp__input_icon dp__input_icons" />
16-
<span class="dp__clear_icon" v-if="$slots['clear-icon'] && clearable" @click.stop.prevent="$emit('clear')"
16+
<span
17+
class="dp__clear_icon"
18+
v-if="$slots['clear-icon'] && clearable && !disabled && !readonly"
19+
@click.stop.prevent="$emit('clear')"
1720
><slot name="clear-icon"></slot
1821
></span>
1922
<CancelIcon
20-
v-if="clearable && !$slots['clear-icon'] && internalValue"
23+
v-if="clearable && !$slots['clear-icon'] && internalValue && !disabled && !readonly"
2124
class="dp__clear_icon dp__input_icons"
2225
@click.prevent="$emit('clear')"
2326
/>

0 commit comments

Comments
 (0)