File tree Expand file tree Collapse file tree
src/BlazorWebFormsComponents/CustomControls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,13 +71,13 @@ public void AddAttribute(string name, string value)
7171 throw new ArgumentNullException ( nameof ( name ) ) ;
7272
7373 // Special handling for class attribute - concatenate instead of replace
74- if ( name . Equals ( "class" , StringComparison . OrdinalIgnoreCase ) && _pendingAttributes . TryGetValue ( "class" , out var existingClass ) )
74+ if ( name . Equals ( "class" , StringComparison . OrdinalIgnoreCase )
75+ && _pendingAttributes . TryGetValue ( "class" , out var existingClass )
76+ && ! string . IsNullOrEmpty ( existingClass )
77+ && ! string . IsNullOrEmpty ( value ) )
7578 {
76- if ( ! string . IsNullOrEmpty ( existingClass ) && ! string . IsNullOrEmpty ( value ) )
77- {
78- _pendingAttributes [ "class" ] = $ "{ existingClass } { value } ";
79- return ;
80- }
79+ _pendingAttributes [ "class" ] = $ "{ existingClass } { value } ";
80+ return ;
8181 }
8282
8383 _pendingAttributes [ name ] = value ?? string . Empty ;
You can’t perform that action at this time.
0 commit comments