Skip to content

Commit

Permalink
fix(combobox): add support for external tooltip elements (#3930)
Browse files Browse the repository at this point in the history
* fix(combobox): add support for external tooltip elements

* chore(combobox): remove unused code paths

* ci: update golden images cache

* docs(combobox): include slot present in API docs
  • Loading branch information
Westbrook Johnson authored and Najika Yoo committed Jan 19, 2024
1 parent 71e8a43 commit 35bc113
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
parameters:
current_golden_images_hash:
type: string
default: c0dc478a43f6c75df5171bf1fbea37cad9cba1c9
default: cd59af5fc3fb16d2c5e42f5c65ae90f247fc2eb6
wireit_cache_name:
type: string
default: wireit
Expand Down
18 changes: 5 additions & 13 deletions packages/combobox/src/Combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ export class Combobox extends Textfield {
this.focus();
}

public handleClosed(): void {
this.open = false;
}

public handleOpened(): void {
// Do stuff here?
}
Expand All @@ -262,16 +266,6 @@ export class Combobox extends Textfield {
return super.shouldUpdate(changed);
}

private positionListbox(): void {
const targetRect = this.overlay.getBoundingClientRect();
const rootRect = this.getBoundingClientRect();
this.listbox.style.transform = `translate(${
targetRect.x - rootRect.x
}px, ${targetRect.y - rootRect.y}px)`;
this.listbox.style.height = `${targetRect.height}px`;
this.listbox.style.maxHeight = `${targetRect.height}px`;
}

protected override onBlur(event: FocusEvent): void {
if (
event.relatedTarget &&
Expand Down Expand Up @@ -309,9 +303,7 @@ export class Combobox extends Textfield {
type="text"
.value=${live(this.displayValue)}
tabindex="0"
@sp-closed=${() => {
this.open = false;
}}
@sp-closed=${this.handleClosed}
@sp-opened=${this.handleOpened}
type=${this.type}
aria-describedby=${this.helpTextId}
Expand Down

0 comments on commit 35bc113

Please # to comment.