Fix multiselect label column collapse and restore control offset

This commit is contained in:
2026-05-25 08:53:56 +02:00
parent 730cc137bb
commit 5da2203517
2 changed files with 20 additions and 2 deletions
+8 -2
View File
@@ -397,13 +397,17 @@
let maxWidth = 0;
labels.forEach((label) => {
const width = Math.ceil(label.getBoundingClientRect().width);
const width = Math.ceil(label.scrollWidth || label.getBoundingClientRect().width);
if (width > maxWidth) {
maxWidth = width;
}
});
panel.style.setProperty('--sg-multiselect-label-column-width', `${maxWidth}px`);
if (maxWidth > 0) {
panel.style.setProperty('--sg-multiselect-label-column-width', `${maxWidth}px`);
} else {
panel.style.removeProperty('--sg-multiselect-label-column-width');
}
});
};
@@ -522,6 +526,8 @@
return;
}
updateMultiselectLabelAlignment();
const panel = demo.querySelector('.sg-pulldown-panel');
if (!panel) {
return;