Line break remains in RichText after deleting second line #7630
Labels
[Feature] Rich Text
Related to the Rich Text component that allows developers to render a contenteditable
[Type] Bug
An existing feature does not function as intended
Describe the bug
After adding multiline text to a
<RichText>
component the content will always receive a trailing<br/>
even after the text has been updated to no longer be multiline.To Reproduce
Steps to reproduce the behavior:
core/button
block."Hello{enter}{enter}World"
to produce a button with multiple lines of text. (note: Already the content isHello<br/>world<br/>
, one<br/>
too many)"World"
to return the button to a single line of textHello<br/>
when it should just beHello
This behavior also exists when the block attribute is saved in comments, not pulled from dom, leaving this in the block comments:
{"content":["Hello",{"type":"br","key":"_domReact1","ref":null,"props":{},"_owner":null,"_store":{}}]}
when it could simply be{"content":["Hello"]}
Expected behavior
Don't leave a trailing
<br/>
when going multiline.Also a
<RichText>
prop that prevents multiple lines altogether would be useful.The text was updated successfully, but these errors were encountered: