[FIX] web: fix datetime picker buttons overflowing

Before this commit, the "Apply" button in date pickers (not datetime)
would overflow from its popover in desktop view since its position is
set to absolute, and since there are no time pickers to extend the
height of the picker it simply overflows.

This commit ensures that the buttons are correctly displayed when there
are no time pickers.

Part-of: odoo/odoo#127734
This commit is contained in:
Julien Mougenot
2023-07-12 16:53:09 +02:00
parent 44df785656
commit f962d071ad
2 changed files with 9 additions and 4 deletions
@@ -78,8 +78,10 @@
</t>
</t>
</div>
<div t-attf-class="o_datetime_buttons position-md-absolute end-0">
<div
class="o_datetime_buttons end-0"
t-att-class="{ 'position-md-absolute': props.type === 'datetime' }"
>
<t t-slot="buttons" />
</div>
</div>
@@ -4,8 +4,11 @@
<DateTimePicker t-props="props.pickerProps">
<t t-set-slot="buttons">
<t t-if="props.pickerProps.type === 'datetime' or Array.isArray(props.pickerProps.value)">
<button class="o_apply btn btn-primary btn-sm w-100 w-md-auto" t-on-click="props.close">
<i class="fa fa-check pe-1" />
<button
class="o_apply btn btn-primary btn-sm w-100 w-md-auto d-flex align-items-center justify-content-center gap-1"
t-on-click="props.close"
>
<i class="fa fa-check" />
<span>Apply</span>
</button>
</t>