fix(autocomplete): duplicate id in clear & selector button (#5750)

This commit is contained in:
WK 2025-10-04 01:10:37 +08:00 committed by GitHub
parent c3224113de
commit 7b7190e222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@heroui/autocomplete": patch
---
duplicate id in clear & selector button in autocomplete (#5738)

View File

@ -446,7 +446,9 @@ export function useAutocomplete<T extends object>(originalProps: UseAutocomplete
const getClearButtonProps = () =>
({
...mergeProps(buttonProps, slotsProps.clearButtonProps),
...slotsProps.clearButtonProps,
preventFocusOnPress: true,
excludeFromTabOrder: true,
// disable original focus and state toggle from react aria
onPressStart: () => {
// this is in PressStart for mobile so that touching the clear button doesn't remove focus from