Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/data/material/components/autocomplete/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ However, you can use different structures by providing a `getOptionLabel` prop.

If your options are objects, you must provide the `isOptionEqualToValue` prop to ensure correct selection and highlighting. By default, it uses strict equality to compare options with the current value.

:::warning
If your options have duplicate labels, you must extract a unique key with the `getOptionKey` prop.

```tsx
const options = [
{ label: 'The Godfather', id: 1 },
{ label: 'The Godfather', id: 2 },
];

return <Autocomplete options={options} getOptionKey={(option) => option.id} />;
```

:::

### Playground

Each of the following examples demonstrates one feature of the Autocomplete component.
Expand Down
Loading