react-native-paper-dropdown icon indicating copy to clipboard operation
react-native-paper-dropdown copied to clipboard

Provide a feature to disable options in dropdown

Open vndpal opened this issue 1 year ago • 1 comments

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 avatar Aug 03 '24 09:08 vndpal

@vndpal thanks for the suggestion, will try to add this feature in a new release

fateh999 avatar Aug 03 '24 12:08 fateh999