react-native-paper-dropdown
react-native-paper-dropdown copied to clipboard
Provide a feature to disable options in dropdown
It would be nice if there is a way to disable few options from the dropdown. it can be implemented like below
const OPTIONS = [
{ label: 'Male', value: 'male',disabled:false },
{ label: 'Female', value: 'female',disabled:true },
{ label: 'Other', value: 'other',disabled:false},
];
export default function App() {
const [gender, setGender] = useState<string>();
return (
<PaperProvider>
<View style={{ margin: 16 }}>
<Dropdown
label="Gender"
placeholder="Select Gender"
options={OPTIONS}
value={gender}
onSelect={setGender}
/>
</View>
</PaperProvider>
);
@vndpal thanks for the suggestion, will try to add this feature in a new release