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

fix(combobox): prevent spacebar from opening the menu when focused on chip's close button #8990

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ describe("calcite-combobox", () => {

const wrapper = await page.find("calcite-combobox >>> .wrapper");
const close = await wrapper.find("calcite-chip >>> .close");
await close.click();
await close.press(" ");
await page.waitForChanges();

const remainingChips = await page.findAll("calcite-combobox >>> calcite-chip");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,17 +681,13 @@ export class Combobox
}
break;
case " ":
if (!this.textInput.value) {
if (!this.textInput.value && !event.defaultPrevented) {
if (!this.open) {
this.open = true;
this.shiftActiveItemIndex(1);
}
event.preventDefault();
}

if (event.composedPath().find((el: HTMLElement) => el.tagName === "CALCITE-CHIP")) {
event.preventDefault();
}
break;
case "Home":
if (!this.open) {
Expand Down
Loading