Skip to content

Commit

Permalink
Merge pull request #1033 from Georglider/main
Browse files Browse the repository at this point in the history
feat: alwaysClearable prop
  • Loading branch information
Jasenkoo authored Dec 28, 2024
2 parents 3fcd0ae + 94ff47d commit 7ed96fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VueDatePicker/components/DatepickerInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
@click="emit('toggle')"
/>
</div>
<span v-if="$slots['clear-icon'] && inputValue && clearable && !disabled && !readonly" class="dp--clear-btn"
<span v-if="$slots['clear-icon'] && (alwaysClearable || inputValue && clearable && !disabled && !readonly)" class="dp--clear-btn"
><slot name="clear-icon" :clear="onClear"
/></span>
<button
v-if="clearable && !$slots['clear-icon'] && inputValue && !disabled && !readonly"
v-if="!$slots['clear-icon'] && (alwaysClearable || clearable && inputValue && !disabled && !readonly)"
:aria-label="defaultedAriaLabels?.clearInput"
class="dp--clear-btn"
type="button"
Expand Down
1 change: 1 addition & 0 deletions src/VueDatePicker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const AllProps = {
placeholder: { type: String as PropType<string>, default: '' },
hideInputIcon: { type: Boolean as PropType<boolean>, default: false },
clearable: { type: Boolean as PropType<boolean>, default: true },
alwaysClearable: { type: Boolean as PropType<boolean>, default: false },
state: { type: Boolean as PropType<boolean | null>, default: null },
required: { type: Boolean as PropType<boolean>, default: false },
autocomplete: { type: String as PropType<string>, default: 'off' },
Expand Down

0 comments on commit 7ed96fd

Please sign in to comment.