Skip to content

Commit

Permalink
[pickers] Fix clearable behavior blocking focus return to `OpenPicker…
Browse files Browse the repository at this point in the history
…Button` (@noraleonte) (#11643)

Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com>
Co-authored-by: Nora <72460825+noraleonte@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and noraleonte committed Jan 11, 2024
1 parent 0c56758 commit e923c98
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/x-date-pickers/src/hooks/useClearableField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ export const useClearableField = <

const InputProps = {
...ForwardedInputProps,
endAdornment: clearable ? (
endAdornment: (
<React.Fragment>
<InputAdornment
position="end"
sx={{ marginRight: ForwardedInputProps?.endAdornment ? -1 : -1.5 }}
>
<IconButton {...iconButtonProps} onClick={onClear}>
<EndClearIcon fontSize="small" {...endClearIconProps} />
</IconButton>
</InputAdornment>
{clearable && (
<InputAdornment
position="end"
sx={{ marginRight: ForwardedInputProps?.endAdornment ? -1 : -1.5 }}
>
<IconButton {...iconButtonProps} onClick={onClear}>
<EndClearIcon fontSize="small" {...endClearIconProps} />
</IconButton>
</InputAdornment>
)}
{ForwardedInputProps?.endAdornment}
</React.Fragment>
) : (
ForwardedInputProps?.endAdornment
),
};

Expand Down

0 comments on commit e923c98

Please sign in to comment.