Do not sum digits for widget width when some parts are unknown
Closes #14384 (grafted from cd8a0670dd5c6274062e92a40a39509105c800ec) --HG-- branch : 7.0
This commit is contained in:
@@ -2101,7 +2101,7 @@ function eval_pyson(value){
|
||||
},
|
||||
get width() {
|
||||
var digits = this.digits;
|
||||
if (digits) {
|
||||
if (digits && digits.every(d => d !== null)) {
|
||||
return digits.reduce(function(acc, cur) {
|
||||
return acc + cur;
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ class Float(Integer):
|
||||
@property
|
||||
def width(self):
|
||||
digits = self.digits
|
||||
if digits:
|
||||
if digits and all(d is not None for d in digits):
|
||||
return sum(digits)
|
||||
else:
|
||||
return self.attrs.get('width', 18)
|
||||
|
||||
Reference in New Issue
Block a user