trumbowyg反应输入数据键入反向顺序
我现在将Trumbowyg编辑器集成到React Project中。
const [content, setContent] = useState();
return (
<Trumbowyg
onChange={e => setContent(e.target.innerHTML)}
data={content}
/>
)
但是对于每个按键事件,光标都会移至起始位置,因此内容会逆转
https://i.sstatic.net/iza0j.png“ alt =“在此处输入图像说明”>
我键入“ start”,但它们的顺序是相反的,您会看到。
I'm now integrating Trumbowyg editor into react project.
const [content, setContent] = useState();
return (
<Trumbowyg
onChange={e => setContent(e.target.innerHTML)}
data={content}
/>
)
But for every keypress event, the cursor moves to the start position, so the content becomes reversed
I typed "start", but they are in reversed order, you see.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RichTexteditor.js
只是复制和使用!
nb:我在这里使用了Next.js
RichTextEditor.js
Just copy and use!
NB: I've used Next.js here
您无需将
内容
传递给trumbowyg
,只需删除它You dont need to pass
content
toTrumbowyg
, just remove it