Skip to content

Conversation

@tenphi
Copy link
Member

@tenphi tenphi commented Nov 11, 2025

Note

Enables single-Enter form submission in ComboBox when allowsCustomValue and no matches, adds tests, and surfaces library version via VERSION and data-tasty.

  • ComboBox:
    • Adjust Enter key handling when no matches: trims input, commits custom value, and lets Enter propagate for form submission if popover is closed and value is non-empty; otherwise prevents default. Updates aria-expanded logic unaffected.
  • Tests:
    • Add integration test ensuring single-Enter commits custom value and submits form when allowsCustomValue and no matches (src/components/fields/ComboBox/ComboBox.test.tsx).
  • Versioning/Root:
    • Introduce VERSION constant in src/version.ts and attach to root via data-tasty in src/components/Root.tsx; ensure window.CubeUIKit.version is defined and check for multiple versions.
  • Changeset:
    • Add patch changeset for @cube-dev/ui-kit describing the ComboBox Enter submission fix.

Written by Cursor Bugbot for commit c9e3b28. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

🦋 Changeset detected

Latest commit: c9e3b28

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

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit 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

@vercel
Copy link

vercel bot commented Nov 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cube-ui-kit Ready Ready Preview Comment Nov 11, 2025 3:10pm
cube-ui-kit-cursor Ready Ready Preview Comment Nov 11, 2025 3:10pm

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

📦 NPM canary release

Deployed canary version 0.0.0-canary-dfdfca0.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

🏋️ Size limit report

Name Size Passed?
All 296.83 KB (+0.05% 🔺) Yes 🎉
Tree shaking (just a Button) 33.33 KB (0% 🟰) Yes 🎉
Tree shaking (just an Icon) 20.59 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

🧪 Storybook is successfully deployed!

e.preventDefault();
}
} else {
e.preventDefault();
Copy link

Choose a reason for hiding this comment

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

Bug: Popover: Enter Submits Form Without Focus.

When the popover is open with matching results but no item is focused, pressing Enter doesn't prevent default, causing premature form submission. The Enter handler falls through all conditions without calling e.preventDefault() when hasResults is true, the input is non-empty, and no item is focused in the list.

Fix in Cursor Fix in Web

// If popover is open OR value is empty, prevent default to avoid premature submission
if (isPopoverOpen || !value) {
e.preventDefault();
}
Copy link

Choose a reason for hiding this comment

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

Bug: Normalize empty custom input to null.

When allowsCustomValue is true and the user enters only whitespace then presses Enter, onSelectionChange is called with an empty string instead of null. The ?? operator on line 613 doesn't convert empty strings to null (only null/undefined), so onSelectionChange("") is called. This is inconsistent with how empty values are handled elsewhere in the component (e.g., lines 631-634), where null is used to represent "no selection". The code should check if the trimmed value is empty and call onSelectionChange(null) instead.

Fix in Cursor Fix in Web

@tenphi tenphi merged commit 24a372e into main Nov 11, 2025
14 checks passed
@tenphi tenphi deleted the fix-combobox-custom-value-submit branch November 11, 2025 15:39
@github-actions github-actions bot mentioned this pull request Nov 11, 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.

2 participants