You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div contenteditable> is now widely adopted as the way to make Rich text editors on the web. I've noticed that we cannot set the value of these elementes using .setValue as it throws an error, and have to resort to manual workarounds.
Solution
when field.setValue is applied and field is <div contenteditable> element, internally VTU should override Elements textContent or innerHTML prop, depending on the value of attribute value is plaintext-only or 'true'. Since this is not widely supported, just going with innerHTML is probably easier.
Problem
<div contenteditable>
is now widely adopted as the way to make Rich text editors on the web. I've noticed that we cannot set the value of these elementes using.setValue
as it throws an error, and have to resort to manual workarounds.Solution
when
field.setValue
is applied and field is<div contenteditable>
element, internally VTU should overrideElement
stextContent
orinnerHTML
prop, depending on the value of attribute value isplaintext-only
or 'true'. Since this is not widely supported, just going withinnerHTML
is probably easier.test-utils/src/domWrapper.ts
Lines 125 to 131 in 05f76b6
Additional context
Cheers ✌️
The text was updated successfully, but these errors were encountered: