Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijbet committed Apr 6, 2024
1 parent fa45f6c commit c6d7476
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/calcite-components/src/components/combobox/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,6 @@ export class Combobox
this.refreshSelectionDisplay();
});

private textLabelElResizeObserver = createObserver("resize", () => {
this.setTooltipText();
});

/** keep track of the rendered textLabelEl */
private textLabelEl: HTMLSpanElement;

Expand Down Expand Up @@ -785,21 +781,17 @@ export class Combobox
textLabelEl.offsetWidth < textLabelEl.scrollWidth ? textLabelEl.innerText : null;
};

private textLabelElResizeObserver = createObserver("resize", this.setTooltipText);

private setTextLabelEl = (el: HTMLSpanElement): void => {
this.textLabelEl = el;

if (el) {
this.setTooltipText();
}
this.setTooltipText();
};

private setTextInputWrapEl = (el: HTMLInputElement): void => {
this.textInput = el;

if (el) {
this.textLabelElResizeObserver?.observe(el);
this.setTooltipText();
}
this.textLabelElResizeObserver?.observe(el);
this.setTooltipText();
};

onBeforeOpen(): void {
Expand Down Expand Up @@ -1588,6 +1580,7 @@ export class Combobox
"label--icon": !!selectedItem?.icon,
}}
key="label"
// eslint-disable-next-line react/jsx-sort-props -- auto-generated by @esri/calcite-components/enforce-ref-last-prop
ref={this.setTextLabelEl}
>
{selectedItem.textLabel}
Expand Down Expand Up @@ -1731,6 +1724,7 @@ export class Combobox
[CSS.selectionDisplaySingle]: singleSelectionDisplay,
}}
key="grid"
// eslint-disable-next-line react/jsx-sort-props -- auto-generated by @esri/calcite-components/enforce-ref-last-prop
ref={this.setChipContainerEl}
>
{!singleSelectionMode && !singleSelectionDisplay && this.renderChips()}
Expand Down

0 comments on commit c6d7476

Please sign in to comment.