Bug
In fc-badge-list.ts, the overflow badge width is computed as:
let overflowWidth = overflow.offsetWidth + parseInt(overflowStyle.marginInline);
getComputedStyle().marginInline is a shorthand property. In browsers that return both values (e.g. "4px 8px"), parseInt reads only the first token and discards the second, producing an incorrect total width. In other browsers the collapsed single-value form happens to work, so the bug is browser-dependent.
The same class of bug was already fixed for per-badge elements in commit 031522c by switching to marginInlineStart + marginInlineEnd:
|
|
|
let elementStyle = getComputedStyle(element); |
|
let elementWidth = element.offsetWidth + parseInt(elementStyle.marginInlineStart) + parseInt(elementStyle.marginInlineEnd); |
|
|
The equivalent fix was not applied to the overflow badge on line 168:
|
overflow.removeAttribute("hidden"); |
|
let overflowStyle = getComputedStyle(overflow); |
|
let overflowWidth = overflow.offsetWidth + parseInt(overflowStyle.marginInline); |
|
|
|
// Reset badges for calculations |
Fix
let overflowWidth = overflow.offsetWidth + parseInt(overflowStyle.marginInlineStart) + parseInt(overflowStyle.marginInlineEnd);
Bug
In
fc-badge-list.ts, the overflow badge width is computed as:getComputedStyle().marginInlineis a shorthand property. In browsers that return both values (e.g."4px 8px"),parseIntreads only the first token and discards the second, producing an incorrect total width. In other browsers the collapsed single-value form happens to work, so the bug is browser-dependent.The same class of bug was already fixed for per-badge elements in commit
031522cby switching tomarginInlineStart+marginInlineEnd:BadgeList/src/main/resources/META-INF/resources/frontend/src/fc-badge-list.ts
Lines 181 to 184 in a2e63ff
The equivalent fix was not applied to the overflow badge on line 168:
BadgeList/src/main/resources/META-INF/resources/frontend/src/fc-badge-list.ts
Lines 166 to 170 in a2e63ff
Fix