font-size is being added which is useless anyway #92

Closed
opened 2026-01-29 17:31:23 +00:00 by claunia · 1 comment
Owner

Originally created by @MarvinKlein1508 on GitHub (May 12, 2021).

Describe the bug
RadzenHtmlEditor adds font-size: 1rem; even if our editor does not support font formatting.

To Reproduce
We are using the RadzenHtmlEditor to allow the user some simple type of formatting such as Bold, Italic, Underline. We don't want the user to change font-sizes or font's at all. Here is our code sample:

<Radzen.Blazor.RadzenHtmlEditor @bind-Value="Input.Text" Style="height: 500px;">
	<RadzenHtmlEditorBold />
	<RadzenHtmlEditorItalic />
	<RadzenHtmlEditorUnderline />
	<RadzenHtmlEditorStrikeThrough />
	<RadzenHtmlEditorUnorderedList />
	<RadzenHtmlEditorOrderedList />
</Radzen.Blazor.RadzenHtmlEditor>

But the HTML is always saved with <span style="font-size: 1rem;">TEXT</span> after each new line. This should not be there if the user does not change the font size at all.

For example:

This is a multiline
text

results in

<span style="font-size:1rem;">This is a multiline</span><br />
<span style="font-size:1rem;">Text</span>

Expected behavior

This is a multiline</span><br />
Text
Originally created by @MarvinKlein1508 on GitHub (May 12, 2021). **Describe the bug** RadzenHtmlEditor adds `font-size: 1rem;` even if our editor does not support font formatting. **To Reproduce** We are using the RadzenHtmlEditor to allow the user some simple type of formatting such as Bold, Italic, Underline. We don't want the user to change font-sizes or font's at all. Here is our code sample: ``` <Radzen.Blazor.RadzenHtmlEditor @bind-Value="Input.Text" Style="height: 500px;"> <RadzenHtmlEditorBold /> <RadzenHtmlEditorItalic /> <RadzenHtmlEditorUnderline /> <RadzenHtmlEditorStrikeThrough /> <RadzenHtmlEditorUnorderedList /> <RadzenHtmlEditorOrderedList /> </Radzen.Blazor.RadzenHtmlEditor> ``` But the HTML is always saved with `<span style="font-size: 1rem;">TEXT</span>` after each new line. This should not be there if the user does not change the font size at all. For example: ``` This is a multiline text ``` results in ``` <span style="font-size:1rem;">This is a multiline</span><br /> <span style="font-size:1rem;">Text</span> ``` **Expected behavior** ``` This is a multiline</span><br /> Text ```
Author
Owner

@akorchev commented on GitHub (May 18, 2021):

We are using the[ browser API](https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/wwwroot/Radzen.Blazor.js#L987I - innerHTML. We don't perform any modification to the value returned.

@akorchev commented on GitHub (May 18, 2021): We are using the[ browser API](https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/wwwroot/Radzen.Blazor.js#L987I - innerHTML. We don't perform any modification to the value returned.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#92