You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Is there a way to disable the MultiSelect but still show the items/chips that have been selected? I tried using disable with the alwaysRenderItemSelected prop. The dropdown is disabled but not showing any of the selected items before its disabled.
Thanks
Expected Result - I need to show what has been selected previously but not allow edits
Actual result - Dropdown is disabled but does not show chips
const [selected, setSelected] = useState([]);
const handleMultiSelectChange = (selectedItems) => {
setState({ ...state, carType: selectedItems })
setSelected(selectedItems);
// Update the selected state when the user makes a selection
console.log("called in multiselect");
};
<View style={styles.container}>
{carTypes ?
<MultiSelect
disable={car && car.id ? true : false}
style={styles.dropdown}
placeholderStyle={styles.placeholderStyle}
selectedTextStyle={styles.selectedTextStyle}
iconStyle={styles.iconStyle}
data={carTypes}
labelField="label"
valueField="value"
activeColor="#91A3B0"
placeholder="Select The Services You Will Provide"
value={selected}
onChange={handleMultiSelectChange}
mode='modal'
renderLeftIcon={() => (
<MaterialCommunityIcons name="road" size={20} color={ colors.HEADER} style {{paddingRight:35}} />
)}
selectedStyle={styles.selectedStyle}
alwaysRenderItemSelected={true}
/>
: null}
</View>
The text was updated successfully, but these errors were encountered:
martyparker13
changed the title
Disable Option But Continue to Display What Has Been Selected
Disabled MultiSelect Not Showing Previous Selected Chips After Being Disabled
Dec 8, 2023
Hi,
Is there a way to disable the MultiSelect but still show the items/chips that have been selected? I tried using disable with the alwaysRenderItemSelected prop. The dropdown is disabled but not showing any of the selected items before its disabled.
Thanks
Expected Result - I need to show what has been selected previously but not allow edits
Actual result - Dropdown is disabled but does not show chips
The text was updated successfully, but these errors were encountered: