Skip to content

Commit

Permalink
[pickers] Fix edge property setting in different button position cases
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Mar 5, 2025
1 parent c8a1fdb commit 792714f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ export function PickerFieldUI(props: PickerFieldUIProps) {
onClick: handleClickOpeningButton,
'aria-label': openPickerAriaLabel,
edge:
clearButtonPosition === 'start' && openPickerButtonPosition === 'start'
? undefined
: openPickerButtonPosition,
// open button is always rendered at the edge
textFieldProps.variant !== 'standard' ? openPickerButtonPosition : false,
},
ownerState,
});
Expand All @@ -187,9 +186,10 @@ export function PickerFieldUI(props: PickerFieldUIProps) {
onClick: onClear,
disabled: fieldResponse.disabled || fieldResponse.readOnly,
edge:
clearButtonPosition === 'end' && openPickerButtonPosition === 'end'
? undefined
: clearButtonPosition,
// clear button can only be at the edge if it's position differs from the open button
textFieldProps.variant !== 'standard' && clearButtonPosition !== openPickerButtonPosition
? clearButtonPosition
: false,
},
ownerState,
});
Expand Down

0 comments on commit 792714f

Please sign in to comment.