diff --git a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx index 971f97f78a484..22efabf85c970 100644 --- a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx +++ b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx @@ -1,8 +1,7 @@ import * as React from 'react'; import clsx from 'clsx'; -import Box from '@mui/material/Box'; import { useFormControl } from '@mui/material/FormControl'; -import { styled, Theme } from '@mui/material/styles'; +import { styled } from '@mui/material/styles'; import useForkRef from '@mui/utils/useForkRef'; import { unstable_composeClasses as composeClasses, @@ -13,11 +12,11 @@ import { fakeInputClasses, getFakeInputUtilityClass } from './fakeTextFieldClass import Outline from './Outline'; import { FakeInputElement, FakeInputProps } from './FakeInput.types'; -const SectionsWrapper = styled(Box, { +const SectionsWrapper = styled('div', { name: 'MuiFakeInput', slot: 'Root', overridesResolver: (props, styles) => styles.root, -})(({ theme, ownerState }: { theme: Theme; ownerState: OwnerStateType }) => { +})<{ ownerState: OwnerStateType }>(({ theme, ownerState }) => { const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'; return { @@ -69,7 +68,7 @@ const SectionsContainer = styled('div', { name: 'MuiFakeInput', slot: 'Input', overridesResolver: (props, styles) => styles.input, -})(({ theme, ownerState }) => { +})<{ ownerState: OwnerStateType }>(({ theme, ownerState }) => { return { fontFamily: theme.typography.fontFamily, fontSize: 'inherit', @@ -215,6 +214,7 @@ interface OwnerStateType extends FakeInputProps { fullWidth?: boolean; variant?: 'filled' | 'outlined' | 'standard'; size?: 'small' | 'medium'; + adornedStart?: boolean; } const FakeInput = React.forwardRef(function FakeInput( diff --git a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.types.ts b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.types.ts index ce00a97694b10..1d7903388d81f 100644 --- a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.types.ts +++ b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.types.ts @@ -23,4 +23,9 @@ export interface FakeInputProps extends FieldsTextFieldProps { label?: string; endAdornment?: React.ReactNode; startAdornment?: React.ReactNode; + onBlur?: React.FocusEventHandler; + onChange?: React.FormEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; } diff --git a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx index c9203397516de..b66344487dc7d 100644 --- a/packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx +++ b/packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx @@ -110,7 +110,6 @@ export const FakeTextField = React.forwardRef(function FakeTextField( ownerState, fullWidth, required, - ...other, }} >