Hello,
I would like to report some bugs in the Rich Text Editor Component (Retool cloud).
I have a Rich Text Editor component inside a form, and I noticed that if I call an event handler the clears the Form component, the rich text editor's value becomes null.
I need the the component to have a default value of null/empty, not actual "null" value.
Also, the initial value of the component is "<*p>text</*p>", but it changes to "<*p><br></p>" when you delete it, or type something then delete. Added the * to avoid formatting.
My workaround for now is to set the component's value to "".
1 Like
Hi @kim.barcelo! I’ve also encountered some quirky behaviors with the Rich Text Editor. If you're trying to pre-populate the default value with HTML, it tends to insert extra tags like paragraph tags or line breaks, which can be a bit frustrating. In the end, I switched over to using a simple text area and converted it to HTML manually (e.g., replacing /n
with <br>
). It worked out much better for my needs! It's not as visually appealing, but does the trick until this bug gets fixed.
1 Like
Thanks for getting in touch! I created an internal ticket to track that bug with clearing a form containing Rich Text Editor.
Regarding the addition of HTML tags, to manage expectations I think it's not likely we will change that behavior since it is a result of the WYSIWYG editing library we are using. I understand how that could be problematic if you're working with HTML generated by hand or using other tools. Still, I think we'd be interested in hearing more about use cases where the generated HTML is problematic so we can keep it in mind for future iterations on rich text editing.
1 Like
@jacobstern I think this could be easily solved by allowing the default text to be formatted using that same WYSIWYG editor. This would allow the user to create the desired format text using your WYSIWYG format. I know it deviates a bit from the typical UI but would solve this particular problem I would imagine.
Use case would be a templated email.
1 Like
@Derek_Watts Thanks for the response! The email use case is definitely interesting.
Regarding "allowing the default text to be formatted using that same WYSIWYG editor", I'm not sure I totally understand the suggestion. If it's not too much of an imposition on your time could you describe a worked example of how you would like it to function for a specific input?
1 Like
No problem, I believe the problem stems from inputing user generated html in to the default value input. It does not align with the way the Rich Editor is formatting html.
My suggestion would be to allow the user to input their default text inside the Rich Editor itself rather than the default field. You still have the problem of someone wanting to programmatically provide existing html.
1 Like
Ah got it thanks! I think we could definitely explore something like that.
1 Like
A fix for the "null" string issue has been released and should be available in Retool Cloud versions 3.124 and greater. Please let us know if you are still seeing problems with that. Thanks again for reporting!