diff --git a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts index 6ec0bc8399..b5dc76f222 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts +++ b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts @@ -177,6 +177,7 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { this.loadPageOfCiphers(); this.inlineMenuListContainer.appendChild(this.ciphersList); + this.toggleScrollClass(); if (!this.showInlineMenuAccountCreation) { return; @@ -973,13 +974,19 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { * * @param height - The height of the inline menu list actions container. */ - private toggleScrollClass = (height: number) => { + private toggleScrollClass = (height?: number) => { if (!this.ciphersList) { return; } const scrollbarClass = "inline-menu-list-actions--scrollbar"; - if (height >= 170) { + let containerHeight = height; + if (!containerHeight) { + const inlineMenuListContainerRects = this.inlineMenuListContainer.getBoundingClientRect(); + containerHeight = inlineMenuListContainerRects.height; + } + + if (containerHeight >= 170) { this.ciphersList.classList.add(scrollbarClass); return; }