1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

[PM-10796] Fix inline menu cipher list scroll behavior (#10500)

* [PM-10796] Fix inline menu setting of scroll class when showing new item button with a list of ciphers

* [PM-10796] Fix inline menu setting of scroll class when showing new item button with a list of ciphers
This commit is contained in:
Cesar Gonzalez 2024-08-14 11:03:38 -05:00 committed by GitHub
parent 5fad072554
commit 910ae7d799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -177,6 +177,7 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement {
this.loadPageOfCiphers(); this.loadPageOfCiphers();
this.inlineMenuListContainer.appendChild(this.ciphersList); this.inlineMenuListContainer.appendChild(this.ciphersList);
this.toggleScrollClass();
if (!this.showInlineMenuAccountCreation) { if (!this.showInlineMenuAccountCreation) {
return; return;
@ -973,13 +974,19 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement {
* *
* @param height - The height of the inline menu list actions container. * @param height - The height of the inline menu list actions container.
*/ */
private toggleScrollClass = (height: number) => { private toggleScrollClass = (height?: number) => {
if (!this.ciphersList) { if (!this.ciphersList) {
return; return;
} }
const scrollbarClass = "inline-menu-list-actions--scrollbar"; 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); this.ciphersList.classList.add(scrollbarClass);
return; return;
} }