Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a feature to disable options in dropdown #114

Open
vndpal opened this issue Aug 3, 2024 · 1 comment
Open

Provide a feature to disable options in dropdown #114

vndpal opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vndpal
Copy link

vndpal commented Aug 3, 2024

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>
  );
@fateh999
Copy link
Owner

fateh999 commented Aug 3, 2024

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

@fateh999 fateh999 self-assigned this Aug 3, 2024
@fateh999 fateh999 added the enhancement New feature or request label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants