From 3f198703f2c9caca76837cab61f46a350c9b3996 Mon Sep 17 00:00:00 2001 From: EMaderbacher Date: Tue, 19 Nov 2024 04:30:30 +0100 Subject: [PATCH] Fixed: When DefaultShown = true, BSCollapse can't be closed (#620) --- .../Shared/Components/Common/BSCollapseBase.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/BlazorStrap/Shared/Components/Common/BSCollapseBase.cs b/src/BlazorStrap/Shared/Components/Common/BSCollapseBase.cs index 19993aa5..fad98f22 100644 --- a/src/BlazorStrap/Shared/Components/Common/BSCollapseBase.cs +++ b/src/BlazorStrap/Shared/Components/Common/BSCollapseBase.cs @@ -38,7 +38,15 @@ public abstract class BSCollapseBase : BlazorStrapToggleBase, IA public bool DefaultShown { get => _defaultShown; - set { _defaultShown = value; if (!_hasRendered) Shown = value; } + set + { + _defaultShown = value; + if (!_hasRendered) + { + Shown = value; + _shown = value; + } + } } ///