RichTextEditor persisting old value and not updating with empty strings.

Good afternoon Syncfusion.

To be clear and starting with I am using the Spreadsheet in conjunction with the RichTextEditor. I am using the onSelect event of the Spreadsheet to pass the argument and get the cell value for the RichTextEditor.

The code for the Spreadsheet and identifying the cell / value is solid and produces the correct data every time on first attempt. Many of the rows are already populated and I am looking to populate others with the RichTextEditor.

Now if I go to any of those pre populated cells I can open the editor, change the data and save it, I can go to any of the populated cells and work without issues, I can also go from empty to populated cells and correctly get the data as expected.

The issue is when I go to an empty cell, I get the expected empty string but after I edit this and save it I then go to another empty cell and the Text Editor persists the previously saved data. this.textData is an empty string before opening the Text Editor but for some reason it is not updating.

However if I can on any other pre populated cell the data is correct, then if I were to go back to an empty cell it comes up as empty.

As you see in the second last picture the Text Editor has 'Test Data' retained from the cell aboves changes, but this object is ''. I have also tried to replace '' with 'Add Text Here' with the same issues.

Provided a dropbox link with a gif for clarity.
https://www.dropbox.com/scl/fi/3qn2p38aa0f6r1lt0dn91/RTE-Issues.gif?rlkey=of6mapkqojau21f6x418apje4&st=882lti9g&dl=0

<ejs-richtexteditor class="text-editor" #textEditor
              [value]="textData"
              [editorMode]='textEditorMode'>
</ejs-richtexteditor>

onSelect
(args: SelectEventArgs){

let cellAddress = args. range;
          let cellInfo = this.spreadsheetObj.getAddressInfo(cellAddress);
          let rowIndex = cellInfo.indices[0];
          let colIndex = cellInfo.indices[1];    
          let cellObj = this.spreadsheetObj.getCell(rowIndex, colIndex);
          let textContent =  cellObj.textContent;
          let cellName = this.getBeforeColon(cellAddress);
          let activeSheet = this.spreadsheetObj.getActiveSheet();
          let address = activeSheet.name;
          this.currentCellAddress = address + '!' + cellName;
          let cellConfiguration = this.getCellConfigurationByCellName(cellName);

if(cellConfiguration.isTextEditor){
              if(textContent){
                let textData = textContent;
                this.toggleTextEditor(textData);
              }
              else{
                let textData = '';
                this.toggleTextEditor(textData);
              }          
            }
}
  toggleTextEditor(textData: string) {
    this.textData = textData;
    console.log(this.textData);
    this.textVisible = !this.textVisible;
  }

Example Spreadsheet columns/cells.

Image_3441_1716443019907

Image_3533_1716443185359
Image_6975_1716443372063

1 Reply

VJ Vinitha Jeyakumar Syncfusion Team May 24, 2024 09:22 AM UTC

Hi Myles Renaud,


Could you please share us with the entire code snippet to replicate the issue on our end? are you using the RichTextEditor inside any Dialog? or using any edit template? 

Share the above details along with simple issue replicating runnable sample or modify the below attached sample with the issue reproducing code to validate further?



Regards,
Vinitha

Loader.
Up arrow icon