Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combobox select on blur tabToSelect #3399

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

ThusharaJ07
Copy link
Contributor

@ThusharaJ07 ThusharaJ07 commented May 10, 2024

Copy link

changeset-bot bot commented May 10, 2024

⚠️ No Changeset found

Latest commit: 37b7afa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented May 10, 2024

@ThusharaJ07 is attempting to deploy a commit to the FED Team Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
saltdesignsystem ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 9:38am

@@ -248,7 +249,7 @@ export const ComboBox = forwardRef(function ComboBox<Item>(

break;
case "Tab":
if (!multiselect && activeState) {
if (tabToSelect && activeState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a breaking change as the single select menu used to select on TAB and now it only will, if you provide this prop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mark-tate @origami-z yes, now with this prop only we will be able to select the typed item on tab key press. the behaviour is kept common for both single/multiselect combobox for consistency.
Let me know if we want to only apply this for multiselect only.

Copy link
Contributor

Choose a reason for hiding this comment

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

From meeting: let's try default to different values in single / multi select

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mark-tate @origami-z Added the below change to not break the existing behaviour >>>
the default value for prop will be:

  • true for single select
  • false for multiselect

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. Let's add some test for both

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@origami-z have added test.

@@ -16,6 +16,7 @@ data:
- If the combo box is single-select and if focus is above the combo box, Tab sets focus on the component. When focused, combo box has a visible text cursor and the list is opened.
- If the combo box is multi-select and if the focus is above the combo box, Tab sets focus on the pill list if pills are present. If no pills are present then focus is set on the input.
- If the list is open, Tab moves focus to the next focusable element in the tab order and selects the current active option.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could combine this with next point?

bhoppers2008
bhoppers2008 previously approved these changes May 30, 2024
@origami-z origami-z changed the title combobox select on blur combobox select on blur tabToSelect May 30, 2024
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.

None yet

4 participants