Skip to content

Commit 7c9a31d

Browse files
authored
fix(Affix): use culture-invariant for position (#6796)
1 parent c183310 commit 7c9a31d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BootstrapBlazor/Components/Affix/Affix.razor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6+
using System.Globalization;
7+
68
namespace BootstrapBlazor.Components;
79

810
/// <summary>
@@ -40,8 +42,8 @@ public partial class Affix
4042
.Build();
4143

4244
private string? StyleString => CssBuilder.Default("position: sticky;")
43-
.AddStyle("z-index", $"{ZIndex}", ZIndex.HasValue)
44-
.AddStyle(Position.ToDescriptionString(), $"{Offset}px")
45+
.AddClass($"z-index: {ZIndex};", ZIndex.HasValue)
46+
.AddClass($"{Position.ToDescriptionString()}: {Offset.ToString(CultureInfo.InvariantCulture)}px;")
4547
.AddStyleFromAttributes(AdditionalAttributes)
4648
.Build();
4749
}

0 commit comments

Comments
 (0)