My app has a page with 3 rich text components along with lot of other input components.
I am assigning a default value to all the input components using data from an API call.
Issue (This happens like 30% of the time, not always)
When I try to edit the value of any component on the page and hit submit, in some cases the value of the rich text input is returned as <p>undefined</p> but when I check the state of the component the value attribute has the correct value.
I even tried adding a button that just console logs <richtextname>.value but still it is <p>undefined</p>. I can see the value correctly rendered on the text box and also the value attribute has the correct value.
Once I edit a rich text field that was once undefined, I get the correct value using <richtextname>.value.
Also this happens for all the 3 rich text boxes at once but not to any other components.
This is how I'm setting the default values. I don't think it matters since no other component has the issue and editState is true by default.
There is no proper way to replicate the issue that I know of, it just happens randomly. One pattern I noticed is that if I tried editing the form like immediately after the form has loaded the issue is more likely to happen.
But what does not make sense to me is that why is value on the state different from <richtextname>.value. It is not because the values are not loaded correctly because when the console log is called. I even tried using a button that just console logs on click but the value is still <p>undefined</p>
Hey @msapcili! No worries, it looks like I misunderstood exactly what was going on here. Good to hear that the workaround may be sufficient for now, but would you mind providing some more context on the initial bug?
I know it's been happening inconsistently for both of you but is there any pattern to when it might show up more often?
You mentioned it occurring if you change the value of some fields, is that specifically when done with the .setValue method or does it happen when someone edits the RTE directly as well?
Are there any other operations fire as part of the flow for editing a text field?
Thanks for all the context @msapcili! I still have yet to reproduce the behavior but this gives some more to go off of. I'll check in with the dev team and report back if I find more information.
Is this on an instance that's being hosted by Retool? If we stepped into your org should we be able to reproduce the behavior (i.e. do your resources have any user-specific authentication), and would you mind if we tried?
Yes, it was being hosted by Retool but I accidentally changed it to another dashboard. I've checked the history but the history list is limited so I cannot revert back to create you the board again.
I see, that's understandable. You mentioned you could consistently reproduce the error with the same content - do you mean a specific piece of text was being particularly problematic? If so, would you be open to sharing it for us to test with on our end?
I'm also curious to know what browser/os you're using or if it's showing up on multiple different platforms.
After a long time, we've reproduced the error with a painful experience again. Our content team feels miserable after they lost their work because of this issue.
Anyway, we can reproduce the error now and can share an app and a content to test it. Can you please suggest me the way to share it with you?
Sure, I can. How should I share the file with you? I cannot upload from here. It says new users cannot upload attachment. Also I don't know that the exported file contains any secrets.
Are you able to send it as a direct message? The export will have some hardcoded data, but we wont have the ability to run any resource queries or see resource/Retool credentials
Hi @msapcili Thanks so much for sending the file. Unfortunately, I don't have an update yet But I just added some notes to the internal ticket. I'll keep this thread updated if I hear anything
How did you manage to workaround the issue with the seperate rich text editors by using a listview. I tried using a list view but the issue still remains the same in my case?
I do believe there is an inherient bug with the Rich text editor, because i have the issue of setting my first one in the ListView to '
undefined
' as well. I noticed it happens when you refresh/update the data, and it happens consistently. I have found a workaround for now, but I do believe it needs to be addressed, I can supply a video if needed, but we have put in place workarounds for it to work everytime.