简体   繁体   English

Trumbowyg React 输入数据类型逆序

[英]Trumbowyg React input data typed reverse order

I'm now integrating Trumbowyg editor into react project.我现在正在将 Trumbowyg 编辑器集成到反应项目中。

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.我输入了“开始”,但它们的顺序相反,你看。

You dont need to pass content to Trumbowyg , just remove it您不需要将content传递给Trumbowyg ,只需将其删除

<Trumbowyg
        onChange={e => setContent(e.target.innerHTML)}
/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 反应形式无法识别键入的输入 - React form not recognizing typed input 如何使用 React Virtualized Infinite loader 以相反的顺序列出数据? - how to list data in reverse order using React Virtualized Infinite loader? 模拟文本输入更改,就好像用户键入了特定键以触发 React 的 onChange 处理程序? - Simulate a text input change as if the user had typed a specific key in order to trigger React's onChange handler? 反应:以相反的顺序渲染列表 - React: Rendering a list in reverse order 如何在第二个自动完成输入中获取特定数据,这取决于在 React.js 中的第一个输入中键入的内容? - How to get a certain data in the second autocomplete input that depend on what typed in the first input in React.js? TinyMCE 输入以相反的顺序写入 - TinyMCE input being written in reverse order React.JS 如何只允许使用“onKeyPress”在输入中输入数字 - React.JS How to allow only digits to be typed in input with 'onKeyPress' React Form:如何添加在输入时消失的错误消息 - React Form: How to add error message that disappear if the input was typed in 在 React 的特定输入字段中输入文本后,如何启用按钮? - How to enable a button once text is typed in a particular input field in React? React Hooks - 输入 1 个字符时,输入失去焦点 - React Hooks - Input loses focus when 1 character is typed in
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM