mirror of
https://github.com/fergalmoran/turnstone.git
synced 2025-12-22 09:49:56 +00:00
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:
@@ -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`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user