autosize filters only if the width > 0
This commit is contained in:
parent
796b2b132d
commit
3bb4e0af9f
|
@ -23,8 +23,9 @@ HTMLSelectElement.prototype.adjustWidth = function () {
|
||||||
singleSelect.style.width = '';
|
singleSelect.style.width = '';
|
||||||
singleSelect.appendChild(option0.cloneNode(true));
|
singleSelect.appendChild(option0.cloneNode(true));
|
||||||
parent.replaceChild(singleSelect, this);
|
parent.replaceChild(singleSelect, this);
|
||||||
if (this.style.width !== singleSelect.offsetWidth + 'px') {
|
const w = singleSelect.offsetWidth;
|
||||||
this.style.width = singleSelect.offsetWidth + 'px';
|
if (w && this.style.width !== w + 'px') {
|
||||||
|
this.style.width = w + 'px';
|
||||||
}
|
}
|
||||||
parent.replaceChild(this, singleSelect);
|
parent.replaceChild(this, singleSelect);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user