Skip to content

Commit 62b85c8

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 #7556 Task: 5212448 X-original-commit: f814b30 Signed-off-by: Pierre Rousseau (pro) <[email protected]> Signed-off-by: Rémi Rahir (rar) <[email protected]>
1 parent 49567a6 commit 62b85c8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

demo/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ 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
}
1012

1113
.o-spreadsheet .o-test-notification {

demo/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ class Demo extends Component {
338338
}
339339

340340
Demo.template = xml/* xml */ `
341-
<div t-if="state.displayHeader" class="d-flex flex flex-column justify-content">
341+
<div t-if="state.displayHeader" class="d-flex flex flex-column justify-content w-100 h-100">
342342
<div class="p-3 border-bottom">A header</div>
343-
<div class="flex-fill" style="height: 100dvh !important;width: 100dvw !important;">
344-
<Spreadsheet model="model" notifyUser="notifyUser" colorScheme="state.colorScheme" t-key="state.key"/>
343+
<div class="flex-fill">
344+
<Spreadsheet model="model" notifyUser="notifyUser" t-key="state.key" colorScheme="state.colorScheme"/>
345345
</div>
346346
</div>
347-
<div t-else="" style="height: 100dvh !important;width: 100dvw !important;">
347+
<div t-else="" class="w-100 h-100">
348348
<Spreadsheet model="model" t-key="state.key" notifyUser="notifyUser" colorScheme="state.colorScheme"/>
349349
</div>
350350
`;

0 commit comments

Comments
 (0)