mirror of
https://github.com/bitwarden/clients.git
synced 2026-07-04 21:05:54 +08:00
[PM-10796] Fix inline menu cipher list scroll behavior (#10500)
Some checks are pending
Chromatic / Check PR run (push) Waiting to run
Chromatic / Chromatic (push) Blocked by required conditions
Scan / Check PR run (push) Waiting to run
Scan / SAST scan (push) Blocked by required conditions
Scan / Quality scan (push) Blocked by required conditions
Testing / Check for test secrets (push) Waiting to run
Testing / Run tests (push) Blocked by required conditions
Testing / Run Rust tests on ${{ matrix.os }} (macos-latest) (push) Waiting to run
Testing / Run Rust tests on ${{ matrix.os }} (ubuntu-latest) (push) Waiting to run
Testing / Run Rust tests on ${{ matrix.os }} (windows-latest) (push) Waiting to run
Some checks are pending
Chromatic / Check PR run (push) Waiting to run
Chromatic / Chromatic (push) Blocked by required conditions
Scan / Check PR run (push) Waiting to run
Scan / SAST scan (push) Blocked by required conditions
Scan / Quality scan (push) Blocked by required conditions
Testing / Check for test secrets (push) Waiting to run
Testing / Run tests (push) Blocked by required conditions
Testing / Run Rust tests on ${{ matrix.os }} (macos-latest) (push) Waiting to run
Testing / Run Rust tests on ${{ matrix.os }} (ubuntu-latest) (push) Waiting to run
Testing / Run Rust tests on ${{ matrix.os }} (windows-latest) (push) Waiting to run
* [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:
parent
5fad072554
commit
910ae7d799
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user