Skip to content

Commit

Permalink
feat(VDateInput): pass location to VMenu (#20854)
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Sek authored Jan 16, 2025
1 parent 70deee7 commit 2cefedb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/vuetify/src/labs/VDateInput/VDateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import { useProxiedModel } from '@/composables/proxiedModel'
import { computed, shallowRef } from 'vue'
import { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util'

// Types
import type { PropType } from 'vue'
import type { StrategyProps } from '@/components/VOverlay/locationStrategies'

// Types
export type VDateInputActionsSlot = {
save: () => void
Expand All @@ -28,7 +32,10 @@ export type VDateInputSlots = {

export const makeVDateInputProps = propsFactory({
hideActions: Boolean,

location: {
type: String as PropType<StrategyProps['location']>,
default: 'bottom start',
},
...makeFocusProps(),
...makeVConfirmEditProps(),
...makeVTextFieldProps({
Expand All @@ -38,7 +45,7 @@ export const makeVDateInputProps = propsFactory({
...omit(makeVDatePickerProps({
weeksInMonth: 'dynamic' as const,
hideHeader: true,
}), ['active']),
}), ['active', 'location']),
}, 'VDateInput')

export const VDateInput = genericComponent<VDateInputSlots>()({
Expand Down Expand Up @@ -107,7 +114,7 @@ export const VDateInput = genericComponent<VDateInputSlots>()({

useRender(() => {
const confirmEditProps = VConfirmEdit.filterProps(props)
const datePickerProps = VDatePicker.filterProps(omit(props, ['active']))
const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location']))
const textFieldProps = VTextField.filterProps(props)

return (
Expand All @@ -127,6 +134,7 @@ export const VDateInput = genericComponent<VDateInputSlots>()({
v-model={ menu.value }
activator="parent"
min-width="0"
location={ props.location }
closeOnContentClick={ false }
openOnClick={ false }
>
Expand Down

0 comments on commit 2cefedb

Please sign in to comment.