summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2019-04-12 08:20:01 +0000
committerNicolas Lempereur <nle@odoo.com>2019-04-12 11:42:15 +0000
commit58c64558a9a3188edccd1c60042de9f6e639b4a1 (patch)
treef1543086ede07109e14009f47fc8cc0bb59d233f /addons/web/static/src/js/fields/basic_fields.js
parent385342b575f6f8510cea6c90108be7b510fd1fa1 (diff)
[FIX] web: checkbox readonly is RO in list editable
Since f4fbaf1efa the structure of checkboxes has been improved, now we have something like: ``` <input type="checkbox" id="checkbox-18" class="custom-control-input"> <label for="checkbox-18" class="custom-control-label">&#8203;</label> ``` With the first input invisible (whilst before it was visible and the clickable element). This cause an issue in an editable list view: - we have a boolean readonly field in a cell - we are on focused on a line (not in the boolean field cell) - we click on the boolean field => the check mark is toggled This is because when we switch cell, we try to activate the widget of the other cell. Before f4fbaf1efa this issue did not happen since the browser do not generate a click event when clicking a disabled checkbox. With this changeset, a disabled FieldBoolean is not focusable as is the case for other fields, so we can't "activate" it. Without the fix, the added test fails with: [clicking disabled checkbox did not work] opw-1958433 closes #32652 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index a4284841130..f924f24d2fa 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -805,7 +805,7 @@ var FieldBoolean = AbstractField.extend({
* @returns {jQuery} the focusable checkbox input
*/
getFocusableElement: function () {
- return this.$input || $();
+ return this.mode === 'readonly' ? $() : this.$input;
},
/**
* A boolean field is always set since false is a valid value.