From 3bb4e0af9f3cb8aaaa2354e17fc8233bf59c78d4 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 7 Jul 2018 20:47:00 +0300 Subject: [PATCH] autosize filters only if the width > 0 --- manage/filters.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manage/filters.js b/manage/filters.js index c3b24ca6..24bb8e7b 100644 --- a/manage/filters.js +++ b/manage/filters.js @@ -23,8 +23,9 @@ HTMLSelectElement.prototype.adjustWidth = function () { singleSelect.style.width = ''; singleSelect.appendChild(option0.cloneNode(true)); parent.replaceChild(singleSelect, this); - if (this.style.width !== singleSelect.offsetWidth + 'px') { - this.style.width = singleSelect.offsetWidth + 'px'; + const w = singleSelect.offsetWidth; + if (w && this.style.width !== w + 'px') { + this.style.width = w + 'px'; } parent.replaceChild(this, singleSelect); };