File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed
src/components/fields/FilterPicker Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -491,24 +491,19 @@ export const MultipleSelection: Story = {
491491 const trigger = canvas . getByRole ( 'button' ) ;
492492 await userEvent . click ( trigger ) ;
493493 } ,
494- render : ( args ) => (
495- < FilterPicker { ...args } >
496- < FilterPicker . Section title = "Fruits" >
497- { fruits . map ( ( fruit ) => (
498- < FilterPicker . Item key = { fruit . key } textValue = { fruit . label } >
499- { fruit . label }
500- </ FilterPicker . Item >
501- ) ) }
502- </ FilterPicker . Section >
503- < FilterPicker . Section title = "Vegetables" >
504- { vegetables . map ( ( vegetable ) => (
505- < FilterPicker . Item key = { vegetable . key } textValue = { vegetable . label } >
506- { vegetable . label }
494+ render : ( args ) => {
495+ const allItems = [ ...fruits , ...vegetables ] ;
496+
497+ return (
498+ < FilterPicker < ( typeof allItems ) [ number ] > { ...args } items = { allItems } >
499+ { ( item ) => (
500+ < FilterPicker . Item key = { item . key } textValue = { item . label } >
501+ { item . label }
507502 </ FilterPicker . Item >
508- ) ) }
509- </ FilterPicker . Section >
510- </ FilterPicker >
511- ) ,
503+ ) }
504+ </ FilterPicker >
505+ ) ;
506+ } ,
512507} ;
513508
514509export const WithCheckboxes : Story = {
You can’t perform that action at this time.
0 commit comments