Skip to content

Commit 6157162

Browse files
committed
fix(combo,select): Invalid styles after reset and user interaction
1 parent 355d2a9 commit 6157162

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/components/combo/combo.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ export default class IgcComboComponent<
476476

477477
addThemingController(this, all);
478478
addSafeEventListener(this, 'blur', this._handleBlur);
479+
addSafeEventListener(this, 'focusin', this._handleFocusIn);
479480

480481
// TODO
481482
this.addEventListener(
@@ -638,6 +639,10 @@ export default class IgcComboComponent<
638639
this.clearSingleSelection();
639640
}
640641

642+
protected _handleFocusIn() {
643+
this._setTouchedState();
644+
}
645+
641646
protected override _handleBlur() {
642647
if (this._selection.isEmpty) {
643648
this._displayValue = '';

src/components/select/select.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ export default class IgcSelectComponent extends FormAssociatedRequiredMixin(
314314
.set(enterKey, this._handleEnter);
315315

316316
addSafeEventListener(this, 'keydown', this._handleSearch);
317+
addSafeEventListener(this, 'focusin', this._handleFocusIn);
317318
addSafeEventListener(this, 'focusout', this._handleFocusOut);
318319
}
319320

@@ -429,6 +430,10 @@ export default class IgcSelectComponent extends FormAssociatedRequiredMixin(
429430

430431
//#region Event listeners
431432

433+
private _handleFocusIn(): void {
434+
this._setTouchedState();
435+
}
436+
432437
private _handleFocusOut({ relatedTarget }: FocusEvent): void {
433438
if (this.contains(relatedTarget as Node)) {
434439
return;

0 commit comments

Comments
 (0)