Skip to content

Conversation

@anserwaseem
Copy link
Collaborator

Describe your changes

  • Added support in the Dropdown widget for creating new options via the allowCreateOptions prop.
  • When a user types a new option, it is now added to the dropdown and selected automatically.
  • To ensure the form's onChange (or Ant Design's onFieldsChange) fires consistently, we introduced a helper that leverages Ant Design's internal RC_FORM_INTERNAL_HOOKS.dispatch.

⚠️ Note: This relies on Ant Design’s private API (RC_FORM_INTERNAL_HOOKS), which may change in future versions.
Alternative approaches like Form.useWatch were considered, but were rejected due to performance trade-offs.
This implementation keeps the change localized to the Dropdown widget and avoids diffing the entire form on every update.

Screenshots [Optional]

er-1103.mov

Issue ticket number and link

Closes #1103

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

@anserwaseem anserwaseem self-assigned this Sep 11, 2025
@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2025

🦋 Changeset detected

Latest commit: 2b90498

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 Sep 11, 2025

Visit the preview URL for this PR (updated for commit 2b90498):

https://react-kitchen-sink-dev--pr1107-1103-support-creatin-lczdiq3l.web.app

(expires Thu, 18 Sep 2025 16:38:21 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9

@anserwaseem anserwaseem force-pushed the 1103-support-creating-new-option-in-dropdown branch from 16c1cf1 to 2b90498 Compare September 11, 2025 16:35
@anserwaseem anserwaseem merged commit 646d154 into main Sep 11, 2025
3 checks passed
@anserwaseem anserwaseem deleted the 1103-support-creating-new-option-in-dropdown branch September 11, 2025 17:12
anserwaseem added a commit that referenced this pull request Oct 24, 2025
anserwaseem added a commit that referenced this pull request Oct 24, 2025
@github-actions github-actions bot mentioned this pull request Oct 24, 2025
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.

Support creating new option in Dropdown

3 participants