From fc9e47778ba291fd9cf813a26ddbf97523ff9318 Mon Sep 17 00:00:00 2001 From: Leigh Pointer Date: Sat, 8 Jan 2022 16:12:27 +0100 Subject: [PATCH] Fix for #1914 Label Control appending Class to LabelClass Modified so that the Class parameter is not constantly appended when a new Class is applied. --- Oqtane.Client/Modules/Controls/Label.razor | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/Label.razor b/Oqtane.Client/Modules/Controls/Label.razor index 4362147d..a1f8bf3f 100644 --- a/Oqtane.Client/Modules/Controls/Label.razor +++ b/Oqtane.Client/Modules/Controls/Label.razor @@ -25,8 +25,8 @@ else [Parameter] public string HelpText { get; set; } // optional - tooltip for this label - private string _spanclass = "app-tooltip"; - private string _labelclass = "form-label"; + private string _spanclass; + private string _labelclass; private string _helptext = string.Empty; protected override void OnParametersSet() @@ -36,11 +36,15 @@ else if (!string.IsNullOrEmpty(HelpText)) { _helptext = Localize(nameof(HelpText), HelpText); - _spanclass += (!string.IsNullOrEmpty(Class)) ? " " + Class : ""; + _labelclass = "form-label"; + + var spanclass = (!string.IsNullOrEmpty(Class)) ? " " + Class : ""; + _spanclass = "app-tooltip" + spanclass; } else { - _labelclass += (!string.IsNullOrEmpty(Class)) ? " " + Class : ""; + var labelclass = (!string.IsNullOrEmpty(Class)) ? " " + Class : ""; + _labelclass = "form-label" + labelclass; } var text = Localize("Text", String.Empty);