From 88854720f5355478b96635b67c5be57108752de9 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Fri, 25 Mar 2022 10:37:17 +0700 Subject: [PATCH] No indeterminate checkboxes in simple modes The simple checkbox modes (field and index) should not produce indeterminate checkboxes. That should be reserved for the advanced modes (list and filter). --- core/modules/widgets/checkbox.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 623d4a788..43fcc95cf 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -92,9 +92,7 @@ CheckboxWidget.prototype.getValue = function() { if(this.checkboxUnchecked && !this.checkboxChecked) { return true; // Absence of unchecked value } - if(this.checkboxChecked && this.checkboxUnchecked) { - return undefined; // Will be rendered as indeterminate - } + // Do *not* return `undefined` in field or index mode: no indeterminate checkboxes in these modes } if(this.checkboxListField || this.checkboxFilter) { // Same logic applies to lists and filters