Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutocompleteItem should be customisable with "className" prop (e.g. cannot change the background color on hover) #1035

Open
GregLuoWestpac opened this issue Feb 14, 2025 · 0 comments

Comments

@GregLuoWestpac
Copy link

I cannot customize the styling of AutocompleteItem (e.g., changing the background color on hover) in Autocomplete because AutocompleteItemProps does not include a className property. As you know, overriding CSS is not the best option.

Suggestion:

Please change ItemProps to ListBoxItemProps because ListBoxItemProps has "className" property.
export type AutocompleteItemProps<T = HTMLElement> = ItemProps & {
/**

  • AutocompleteItem body content
    */
    children?: ReactNode;
    };

Change to:
import type {ListBoxItemProps} from 'react-aria-components';

export type AutocompleteItemProps<T = HTMLElement> = ListBoxItemProps & {
/**

  • AutocompleteItem body content
    */
    children?: ReactNode;
    };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant