diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-05-08 08:12:06 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-05-08 10:52:12 +0000 |
| commit | f427a38c4e0dcd63d086706ad66a3e5570fbf0aa (patch) | |
| tree | f425a3dfcf72fd9e9d34b32603d98050a181209d /addons/web/static/src | |
| parent | e09120a1d65629ec2d7c8b15bcedeaf8cbd7a33b (diff) | |
[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 <select/> tag
and is added outside of the modal, so when we click
on the select, bootstrap will focus on the modal which
in firefox seems to lose the focus on the <select/>
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) <nle@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 5 |
1 files changed, 5 insertions, 0 deletions
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(); + }); }, }); |
