Open digitalw opened 2 years ago
When the list for "value" is non empty, i get 1 item selected, however the list below is empty (not displaying anything). I used the example as a guide.here is my code:
const [selectedTwo, setSelectedTwo] = useState(selected?selected:[]); . . . <MultiSelectListBox className={"multi-select"} overrideStrings={{ search: "Search...", selectAll: "Add All", removeAll: "Remove All", selectedInfo: "Items selected" }} sortable={true} options={availableDisciplines} textField="name" valueField="id" value={selectedTwo} rowHeight={25} onSelect={({ item, sortedList }) => { add_discipline(item,sortedList) }} onRemove={({ item }) => { remove_disciplie(item) }} onSelectAll={selectedItems => { const selected = [ ...selectedTwo, ...selectedItems.map(item => item.id) ]; setSelectedTwo(selected); }} onRemoveAll={() => setSelectedTwo([])} onSort={({ sortedList }) => setSelectedTwo([...sortedList.map(i => i.id)]) } />
same happens in example code: https://codesandbox.io/s/multi-select-listbox-example-lgvdf?file=/src/App.js
When the list for "value" is non empty, i get 1 item selected, however the list below is empty (not displaying anything). I used the example as a guide.here is my code:
same happens in example code: https://codesandbox.io/s/multi-select-listbox-example-lgvdf?file=/src/App.js