[FIX] web: datepicker inside a dropdown

Steps to reproduce:

1. Go to Project
2. Filter > Add custom filter > Last Updated on
3. Click on the date field and use the date picker to change the value
4. The dropdown is closed and you lost your selection => BUG

This bug was due to a conflict between owl and bs dropdown (e4f87710),
to prevent this bug, we added a check to ensure there are no open
bootstrap calendar inside the current dom.

Note that if you click outside the dropdown, the datepicker is already
closed when you go through this code. It means that the datepicker will
not be present in the DOM anymore and the dropdown can be closed too.

opw-2373573

closes odoo/odoo#61262

X-original-commit: 73dfc1f7a8e2197fcdd4053ec57c260576593a15
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: res-odoo <res-odoo@users.noreply.github.com>
This commit is contained in:
Romain Estievenart
2020-11-03 12:50:41 +00:00
parent 0356e543c2
commit f00fcbfca6
@@ -154,6 +154,10 @@ odoo.define('web.DropdownMenu', function (require) {
return;
}
}
// check for an active open bootstrap calendar like the filter dropdown inside the search panel)
if (document.querySelector('body > .bootstrap-datetimepicker-widget')) {
return;
}
this.state.open = false;
}
}