fix: create new option incase of no exact match found#1125
fix: create new option incase of no exact match found#1125justEhmadSaeed merged 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: c073efd The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
There was a problem hiding this comment.
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()tosome()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.
|
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 |
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
pnpm changeset add