Skip to content

feat: add option to allow clearing selection in dropdown#1040

Merged
justEhmadSaeed merged 2 commits intomainfrom
1039-allow-clear-option-for-dropdown
Feb 13, 2025
Merged

feat: add option to allow clearing selection in dropdown#1040
justEhmadSaeed merged 2 commits intomainfrom
1039-allow-clear-option-for-dropdown

Conversation

@justEhmadSaeed
Copy link
Member

Describe your changes

Screenshots [Optional]

Issue ticket number and link

Closes #1039

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests
  • I have added a changeset pnpm changeset add
  • I have added example usage in the kitchen sink app

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: 7c05e82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@ensembleui/react-kitchen-sink Patch
@ensembleui/react-runtime Patch
@ensembleui/react-preview Patch
@ensembleui/react-starter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2025

Visit the preview URL for this PR (updated for commit 7c05e82):

https://react-kitchen-sink-dev--pr1040-1039-allow-clear-opt-3lhdjsvc.web.app

(expires Thu, 20 Feb 2025 17:48:50 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9

<div ref={rootRef} style={{ flex: 1, ...formItemStyles }}>
<EnsembleFormItem values={values}>
<Select
allowClear={values?.allowClear || false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could just use double bang !!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evshi eslint doesn't allow me to do that. It suggests using Boolean as its alternative

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then listen to eslint :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evshi had to change it to use ?? to make it true by default

<div ref={rootRef} style={{ flex: 1, ...formItemStyles }}>
<EnsembleFormItem values={values}>
<Select
allowClear={values?.allowClear || false}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep it to true by default conforming with behavior of other such widgets like MultiSelect and Search

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anserwaseem updated

@justEhmadSaeed justEhmadSaeed merged commit b931829 into main Feb 13, 2025
3 checks passed
@justEhmadSaeed justEhmadSaeed deleted the 1039-allow-clear-option-for-dropdown branch February 13, 2025 18:00
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.

Allow Clear Option for Dropdown widget

3 participants