From ffe1c35c0b2b59acfbc49bfc345e477f680e1f44 Mon Sep 17 00:00:00 2001 From: DBowen33 <42016383+DBowen33@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:04:33 +0000 Subject: [PATCH] fix(material/chips): fix focus issue (#29427) fix focus issue fixes b/290959510 (cherry picked from commit e69b2b09efaf577cd5fe92b70808479f975913af) --- src/material/chips/chip-grid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material/chips/chip-grid.ts b/src/material/chips/chip-grid.ts index 1c57110d6f56..60cb8f6af3bd 100644 --- a/src/material/chips/chip-grid.ts +++ b/src/material/chips/chip-grid.ts @@ -340,7 +340,7 @@ export class MatChipGrid // Delay until the next tick, because this can cause a "changed after checked" // error if the input does something on focus (e.g. opens an autocomplete). Promise.resolve().then(() => this._chipInput.focus()); - } else if (this._chips.length) { + } else if (this._chips.length && this._keyManager.activeItemIndex !== 0) { this._keyManager.setFirstItemActive(); }