You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect CSS value generation when current culture uses comma as decimal separator #577
In the Tree View (and also Tree Select) component:
The computed CSS should be: padding-left: 1.75rem; but is generated as: padding-left: 1,75rem; which is not a valid CSS value.
During a quick review of BbTreeItem.razor.cs, I found the following code: private string NodeStyle => $"padding-left: {(Depth * 1.25) + 0.5}rem;";. Since string interpolation uses the current culture by default, a culture with a comma decimal separator produces invalid CSS.
Steps to Reproduce
Set the browser (or application) culture to a locale that uses a comma as the decimal separator.
Open the Tree View component documentation page.
Navigate to the Data-Driven example. Notice that nodes such as Components and Pages appear at the same indentation level as src because the generated padding-left value is invalid.
Impact
The issue is immediately visible in the Tree View and Tree Select components because some nodes are not indented correctly.
However, this problem is likely not limited to these components. It could potentially occur anywhere numeric values are interpolated into CSS, inline styles or SVG attributes. In some cases, the issue may not be visually obvious, so there could be additional affected locations that have not yet been identified.
Suggested Fix
Use culture-invariant formatting when converting numeric values to strings, for example:
Activity
fix(NumericInput): keep decimals through focus and blur under comma-d…
fix: write ARIA and data-* numbers invariantly under comma-decimal cu…