diff --git a/packages/vuetify/src/components/VConfirmEdit/VConfirmEdit.tsx b/packages/vuetify/src/components/VConfirmEdit/VConfirmEdit.tsx index 6250146aaed..730c6b66234 100644 --- a/packages/vuetify/src/components/VConfirmEdit/VConfirmEdit.tsx +++ b/packages/vuetify/src/components/VConfirmEdit/VConfirmEdit.tsx @@ -19,7 +19,7 @@ export type VConfirmEditSlots = { save: () => void cancel: () => void isPristine: boolean - get actions (): VNode + get actions (): (props?: {}) => VNode } } @@ -77,9 +77,8 @@ export const VConfirmEdit = genericComponent ( emit('cancel') } - let actionsUsed = false - useRender(() => { - const actions = ( + function actions (actionsProps?: {}) { + return ( <> ( color={ props.color } onClick={ cancel } text={ t(props.cancelText) } + { ...actionsProps } /> ( color={ props.color } onClick={ save } text={ t(props.okText) } + { ...actionsProps } /> ) + } + + let actionsUsed = false + useRender(() => { return ( <> { @@ -113,7 +118,7 @@ export const VConfirmEdit = genericComponent ( }) } - { !actionsUsed && actions } + { !actionsUsed && actions() } ) }) diff --git a/packages/vuetify/src/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.tsx b/packages/vuetify/src/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.tsx index 0e6a7b53889..5be730c0c61 100644 --- a/packages/vuetify/src/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.tsx +++ b/packages/vuetify/src/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.tsx @@ -79,7 +79,7 @@ describe('VConfirmEdit', () => { it('render actions', () => { render(() => ( - { ({ actions }) => actions } + { ({ actions }) => actions() } )) expect(screen.getAllByCSS('button')).toHaveLength(2) diff --git a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx index e451bfc76e9..54202f7cddc 100644 --- a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx +++ b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx @@ -146,7 +146,7 @@ export const VDateInput = genericComponent()({ onMousedown={ (e: MouseEvent) => e.preventDefault() } > {{ - actions: !props.hideActions ? () => actions : undefined, + actions: !props.hideActions ? actions : undefined, }} )