segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

Combobox `autocompleteProps` should be `Omit<AutocompleteProps, 'children' | 'items' | 'onChange'>` #1525

Closed brandongregoryscott closed 1 year ago

brandongregoryscott commented 1 year ago

When providing autocompleteProps to the Combobox, it requires items, onChange, and children, which don't really make sense - the Combobox component manages these internally. It looks like the Combobox spreads these props after the items/onChange from its own props, so it won't "break" anything by allowing these thru, but it's not really the intended API of the component.

See this CodeSandbox for an example of passing items and onChange through autocompleteProps: https://codesandbox.io/s/combobox-autocompleteprops-override-dc4rle?file=/index.js