Sun Rich Text Editor - Bug Wrong Color Displayed

0
I found some weird behavior with the Sun Rich Text Editor in my application.This is an easy way I found to recreate the problem:Write 'Test 123'Put '123' in bold and in some colorDelete '123'Write '123' againNow '123' appears to be in bold and no longer colored, but I know in reality the color is still there. I can check this using the dev tools of my browser to check the html. This becomes an issue when I later display the text retrieved from the widget and it is in fact colored still.I wonder if anyone else experienced this issue and if there is a way to fix it.This is what I see in my editor after I execute the steps described above:This is the html I can see in dev tools after I execute the steps described above:<div class="se-wrapper-inner se-wrapper-wysiwyg sun-editor-editable" contenteditable="true" scrolling="auto" style="height: 600px;"><p><br>Test <font color="#ff00dd"><strong>123</strong></font></p></div>
asked
2 answers
1

Hi Robin,

I was able to reproduce the behavior you described, and from the HTML you shared it looks like the color formatting is not actually being removed when the text is deleted.

After deleting 123 and typing it again, the editor appears to lose the visual color indication in the editing area, but the underlying HTML still contains:



which explains why the text is displayed with the color when rendered elsewhere.

To me this looks more like a synchronization/rendering issue within the Sun Editor rather than a Mendix persistence issue. The editor UI is showing one thing, while the generated HTML contains different formatting information.

A few things I would check:

  • Test the same scenario in a clean sample app to rule out custom styling.
  • Verify whether the issue occurs across multiple browsers.
  • Check whether you're running the latest version of the Sun Rich Text Editor widget, as this could already be a known bug.
  • Inspect the saved attribute value after committing the object. If the color markup is still present in the stored HTML, that further confirms the issue is in the editor's visual representation rather than the data itself.

If the behavior is reproducible in a clean application, I'd strongly consider raising a bug report with the widget maintainer and providing the exact reproduction steps you've listed above. The fact that the editor display and generated HTML are out of sync is usually enough evidence for a defect report.

Out of curiosity, does pressing "Remove Formatting" before retyping the text change the behavior? That might help determine whether the editor is retaining formatting state after the deletion.


answered
0

Hi Robin,

You can make use of the Rich Text widget below:


Rich Text Widget


I have used this widget and have never faced any issues with it.

answered