Skip to content

Conversation

@justEhmadSaeed
Copy link
Member

@justEhmadSaeed justEhmadSaeed commented Oct 27, 2025

Describe your changes

The create new option functionality of Multiselect was making empty selections in case there were some matching options but not having the exact matches.
This PR changes it to create the new option even if there are some matching options available, but no exact match is found

Screenshots [Optional]

Screen.Recording.2025-10-27.at.4.51.54.PM.mov

Issue ticket number and link

Closes #

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 Oct 27, 2025

🦋 Changeset detected

Latest commit: c073efd

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-runtime Patch
@ensembleui/react-kitchen-sink 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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the MultiSelect widget's "create new option" functionality to only trigger when there's no exact match, rather than when there's no partial match. Previously, if any option contained the search text as a substring, the create option feature wouldn't activate even if none of the options matched exactly.

Key changes:

  • Modified the option existence check from partial string matching (search()) to exact case-insensitive matching
  • Changed from find() to some() for better performance since only existence needs to be checked

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/runtime/src/widgets/Form/MultiSelect.tsx Updated option matching logic to use exact comparison instead of substring search
.changeset/poor-pots-speak.md Added changeset documenting the bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

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

https://react-kitchen-sink-dev--pr1125-fix-multiselect-newo-kx5iegwa.web.app

(expires Mon, 03 Nov 2025 11:58:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9

@justEhmadSaeed justEhmadSaeed merged commit eecc1ca into main Oct 27, 2025
3 checks passed
@justEhmadSaeed justEhmadSaeed deleted the fix-multiselect-newoptions branch October 27, 2025 13:54
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.

3 participants