Allow functions for listbox and defaultListbox props

Extend listbox and defaultListbox prop types to allow functions returning a promise resolving to an array of group settings
This commit is contained in:
Tom Southall
2022-04-02 23:35:52 +01:00
parent 791622770a
commit c1d53e1d2b
8 changed files with 307 additions and 59 deletions

View File

@@ -38,6 +38,7 @@ export default function Container(props) {
enterKeyHint,
errorMessage,
id,
listbox,
listboxIsImmutable,
maxItems,
minQueryLength,
@@ -56,11 +57,6 @@ export default function Container(props) {
Clear
} = props
// Destructure listbox prop
const listbox = Array.isArray(props.listbox)
? props.listbox
: [{ ...props.listbox, ...{ name: '', ratio: maxItems } }]
const listboxId = `${id}-listbox`
const errorboxId = `${id}-errorbox`