Skip to content

Commit

Permalink
Omit children, items, and onChange from Combobox.autocompleteProps (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
brandongregoryscott committed Oct 25, 2022
1 parent 0e772df commit f16ca39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ export interface ComboboxOwnProps {
/**
* Properties forwarded to the autocomplete component. Use with caution.
*/
autocompleteProps?: AutocompleteProps
autocompleteProps?: Omit<AutocompleteProps, 'children' | 'items' | 'onChange'>
/**
* When true, open the autocomplete on focus.
*/
Expand Down
6 changes: 5 additions & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectAssignable, expectType, expectError } from 'tsd'
import { defaultTheme, mergeTheme, StyleProps, Intent, Theme, Fill, Partial, Pick, Color } from '.'
import { defaultTheme, mergeTheme, StyleProps, Intent, Theme, Fill, Partial, Pick, Color, ComboboxProps } from '.'

interface ThemeOverrides extends Partial<Pick<Theme, 'colors' | 'fills' | 'components'>> {
colors: {
Expand Down Expand Up @@ -125,3 +125,7 @@ const themeWithTopLevelColorsArray = {
colors: ['#0f4880', '#1d781d', '#db0a5b', '#8d6708', '#d43900']
}
expectError(mergeTheme(defaultTheme, themeWithTopLevelColorsArray))

expectError<ComboboxProps>({ autocompleteProps: { children: 'error' } })
expectError<ComboboxProps>({ autocompleteProps: { onChange: () => {} } })
expectError<ComboboxProps>({ autocompleteProps: { items: [] } })

0 comments on commit f16ca39

Please sign in to comment.