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/combobox-item: tabbing out after selecting chips by clicking leaves the listbox open and focused #4289

Closed
Elijbet opened this issue Mar 23, 2022 · 4 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.

Comments

@Elijbet
Copy link
Contributor

Elijbet commented Mar 23, 2022

Actual Behavior

If you use arrow down to add chips and tab out of it, it works correctly, but if you click on items to add chips and tab out if it, it'll proceed to focus on the next element, leaving the current combobox open and focused.

combobox.tabbing.out.bug.mov

Expected Behavior

Tabbing out of combobox after click & select chips should work exactly like tabbing out of combobox after ArrowUp/Down & select chips, which is by closing the listbox, unfocusing and only then focusing on the next element.
Follow up with a test.

Reproduction Sample

https://codepen.io/elijbet/pen/oNpYbMa

Reproduction Steps

  1. Click on Combobox to open.
  2. Press ArrowDown key down to Pine and click Enter to add a chip.
  3. Tab and another Tab to see it close the listbox and unfocus.
  4. Click on Combobox to open.
  5. Click on Pine Nested to add another chip.
  6. Tab and another Tab to see it move to the next element without closing the listbox or unfocusing the current element.

Reproduction Version

v1.0.0-beta.80

Relevant Info

Related to PR #4218 and Issue #4265

Video:

combobox.tabbing.out.bug.mov

Regression?

No response

@Elijbet Elijbet added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Mar 23, 2022
@benelan benelan removed the needs triage Planning workflow - pending design/dev review. label Mar 25, 2022
@benelan benelan added this to the Sprint 04/11 - 04/22 milestone Mar 25, 2022
@driskull
Copy link
Member

This seems to fix it but i'm not sure if its the correct approach.

diff --git a/src/components/combobox/combobox.tsx b/src/components/combobox/combobox.tsx
index 378b4c5f2f27c7fc4f12390baa17bf4f28169f4a..f39cf1b4ba70fe28aeb4300fca43a6aebee0a3b1 100644
--- a/src/components/combobox/combobox.tsx
+++ b/src/components/combobox/combobox.tsx
@@ -748,6 +748,7 @@ export class Combobox implements LabelableComponent, FormComponent, InteractiveC
       this.resetText();
       this.filterItems("");
     }
+    this.setFocus();
   }
 
   updateAncestors(item: HTMLCalciteComboboxItemElement): void {

``

@Elijbet
Copy link
Contributor Author

Elijbet commented Apr 28, 2022

This seems to fix it but i'm not sure if its the correct approach.

diff --git a/src/components/combobox/combobox.tsx b/src/components/combobox/combobox.tsx
index 378b4c5f2f27c7fc4f12390baa17bf4f28169f4a..f39cf1b4ba70fe28aeb4300fca43a6aebee0a3b1 100644
--- a/src/components/combobox/combobox.tsx
+++ b/src/components/combobox/combobox.tsx
@@ -748,6 +748,7 @@ export class Combobox implements LabelableComponent, FormComponent, InteractiveC
       this.resetText();
       this.filterItems("");
     }
+    this.setFocus();
   }
 
   updateAncestors(item: HTMLCalciteComboboxItemElement): void {

``

This seemed to work, but introduced a regression, so I reworked it a bit.

@Elijbet Elijbet added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels May 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2022

Installed and assigned for verification.

@github-actions github-actions bot assigned geospatialem and unassigned Elijbet May 5, 2022
@benelan
Copy link
Member

benelan commented May 9, 2022

verified on next

@benelan benelan closed this as completed May 9, 2022
@benelan benelan added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.
Projects
None yet
Development

No branches or pull requests

4 participants