Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#3137): expose closeOnContentClick prop from dropdown to time and date pickers #3180

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/ui/src/components/va-date-input/VaDateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ export default defineComponent({
modelValue: { type: [Date, Array, Object, String, Number] as PropType<DateInputModelValue> },
resetOnClose: { type: Boolean, default: true },
closeOnContentClick: { type: Boolean, default: false },
offset: { ...VaDropdownProps.offset, default: () => [2, 0] },
isOpen: { type: Boolean, default: undefined },
format: { type: Function as PropType<(date: DateInputModelValue) => string> },
Expand Down Expand Up @@ -391,12 +393,11 @@ export default defineComponent({
...omit(attrs, ['class', 'style']),
}))
const filteredProps = filterComponentProps(VaDropdownProps)
const dropdownPropsComputed = computed(() => ({
...filterComponentProps(VaDropdownProps).value,
offset: [2, 0] as DropdownOffsetProp,
...filteredProps.value,
stateful: false,
keyboardNavigation: true,
closeOnContentClick: false,
innerAnchorSelector: '.va-input-wrapper__field',
}))
Expand Down
9 changes: 5 additions & 4 deletions packages/ui/src/components/va-time-input/VaTimeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export default defineComponent({
...useValidationProps as ValidationProps<Date>,
isOpen: { type: Boolean, default: undefined },
closeOnContentClick: { type: Boolean, default: false },
offset: { ...VaDropdownProps.offset, default: () => [2, 0] },
placement: { ...VaDropdownProps.placement, default: 'bottom-start' },
modelValue: { type: Date, default: undefined },
clearValue: { type: Date, default: undefined },
format: { type: Function as PropType<(date?: Date) => string> },
Expand Down Expand Up @@ -326,12 +329,10 @@ export default defineComponent({
...omit(attrs, ['class', 'style']),
}))
const filteredProps = filterComponentProps(VaDropdownProps)
const dropdownPropsComputed = computed(() => ({
...filterComponentProps(VaDropdownProps).value,
closeOnContentClick: false,
offset: [2, 0] as DropdownOffsetProp,
...filteredProps.value,
keyboardNavigation: true,
placement: 'bottom-start' as Placement,
innerAnchorSelector: '.va-input-wrapper__field',
}))
Expand Down