From f427a38c4e0dcd63d086706ad66a3e5570fbf0aa Mon Sep 17 00:00:00 2001 From: "Nasreddin (bon)" Date: Fri, 8 May 2020 08:12:06 +0000 Subject: [PATCH] [FIX] web: Handle time select in modal with firefox Issue - Install sale_renting - Create a rental order - Add a "rental" product - In Modal, change start or end time In Firefox, user not allowed to change the time; time select not reacting well. Cause The issue seems to be that in bootstrap when we click outside a modal, we focus on the modal: https://github.com/odoo/odoo/blob/27f67bfcb903/addons/web/static/lib/bootstrap/js/modal.js#L332-L337 and the FieldDateRange widget contains a which get closed. Solution not propagating focusin event when the select of the daterange widget is focused => in my opinion this is the less risky solution, this could be done with a code such as (in the FieldDateRange._renderEdit method): opw-2240220 closes odoo/odoo#50906 X-original-commit: 5a1e9e32061996ca1770c9ae9b5a7e7f53c5048f Signed-off-by: Nicolas Lempereur (nle) --- addons/web/static/src/js/fields/basic_fields.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 4c5bef2c366..f5f59235a0c 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -705,6 +705,11 @@ var FieldDateRange = InputField.extend({ self.$el.data('daterangepicker').hide(); } }); + + // Prevent bootstrap from focusing on modal (which breaks hours drop-down in firefox) + this.$pickerContainer.on('focusin.bs.modal', 'select', function (ev) { + ev.stopPropagation(); + }); }, });