Use 100dvh to fix layout issue in mobile devices

This commit is contained in:
aditya.chandel
2025-07-19 14:37:45 -06:00
committed by Aditya Chandel
parent de005398df
commit fe2d307d2a
21 changed files with 22 additions and 22 deletions
@@ -12,7 +12,7 @@
.virtual-scroller {
width: 100%;
height: calc(100vh - 10.9rem);
height: calc(100dvh - 10.9rem);
padding: 1rem;
box-sizing: border-box;
overflow-y: auto;
@@ -1,4 +1,4 @@
<div class="h-[calc(100vh-6.1rem)] rounded-xl bg-[var(--card-background)] flex flex-col">
<div class="h-[calc(100dvh-6.1rem)] rounded-xl bg-[var(--card-background)] flex flex-col">
<div class="flex items-center justify-between px-4 py-4">
<span class="text font-semibold">Filter Mode</span>
@@ -10,7 +10,7 @@
showGridlines
stripedRows
[scrollable]="true"
[scrollHeight]="'calc(100vh - 160px)'"
[scrollHeight]="'calc(100dvh - 160px)'"
[virtualScroll]="true"
[virtualScrollItemSize]="46"
[(selection)]="selectedBooks"
@@ -84,7 +84,7 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges {
ngOnChanges() {
const wrapperElements: HTMLCollection = document.getElementsByClassName('p-virtualscroller');
Array.prototype.forEach.call(wrapperElements, function (wrapperElement) {
wrapperElement.style["height"] = 'calc(100vh - 160px)';
wrapperElement.style["height"] = 'calc(100dvh - 160px)';
});
}