Skip to content

Add support for custom selected text in Dropdown component #347

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

narender56
Copy link

Description

  • Added a new prop selectedText to let users set their own text to show for the selected value in the dropdown. By default, it shows the selected item label, but now you can override it with any string you want.

Why?

  • Original dropdown didn’t let me customize the displayed selected text, which I needed for my use case. This adds that flexibility without breaking anything.

How to use:

<Dropdown
  data={data}
  value={selectedValue}
  selectedText={"You picked: " + selectedValue}
  ...
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants