Skip to content

Commit f814b30

Browse files
committed
[FIX] Demo: Fix wrapper style
When we introduced the mobile mode, we started relying on the dynamic vewport height (dvh) to account for the resizing of the viewport when the virtual keyboard of a smarphone would pop up. However, the rule we chose was to set the height of spreadsheet wrapper to 100dvh, which stands for 100% of the dynamic viewport height. As such, if we were to add some header before the Spreadsheet component, the latter would keep its size as 100% of the viewport, meaning that the full component is pushed downwards and it overflows from the page. This revision places the 100dvh rule over the full page to account for any header that could be added in the future. closes #7468 Task: 5212448 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
1 parent 411165c commit f814b30

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

demo/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ body {
66
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu,
77
"Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
88
"Noto Color Emoji" !important;
9+
height: 100dvh !important;
10+
width: 100dvw !important;
911
}

demo/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ class Demo extends Component {
326326
}
327327

328328
Demo.template = xml/* xml */ `
329-
<div t-if="state.displayHeader" class="d-flex flex flex-column justify-content">
329+
<div t-if="state.displayHeader" class="d-flex flex flex-column justify-content w-100 h-100">
330330
<div class="p-3 border-bottom">A header</div>
331-
<div class="flex-fill" style="height: 100dvh !important;width: 100dvw !important;">
331+
<div class="flex-fill">
332332
<Spreadsheet model="model" notifyUser="notifyUser" t-key="state.key"/>
333333
</div>
334334
</div>
335-
<div t-else="" style="height: 100dvh !important;width: 100dvw !important;">
335+
<div t-else="" class="w-100 h-100">
336336
<Spreadsheet model="model" t-key="state.key" notifyUser="notifyUser"/>
337337
</div>
338338
`;

0 commit comments

Comments
 (0)