Ant Design Input/React DND - 使用 react-dnd 时无法在 Ant Design Input 内移动文本指针 [英] Ant Design Input / React DND - Unable to move text pointer inside Ant Design Input when using react-dnd
问题描述
我正在处理一个项目,其中有一个 Ant 设计表,其中包含输入字段行.这些行可移动/可拖动.我正在使用 react-dnd 来实现这一点.
I am working on a project where I have an Ant Design Table, containing rows of Input Fields. These rows and moveable/draggable. I am using react-dnd to achieve this.
我面临的问题是在使用 Firefox 浏览器时,我无法在输入字段中移动文本光标/指针,而在使用任何其他浏览器时我可以.
The problem that I am facing is when using Firefox browser, I can not move the text cursor/pointer in the Input field, when I am using any other browser I can.
我知道并理解很难在 Input 中选择文本,因为它会导致行移动.我已经找到了解决方法,尽管这不是我真正的问题.
I know and understand that it is difficult to select text inside the Input because it will cause the row to move. I have already found a workaround for that, even though that is not my real problem.
这是演示项目的链接:https://codesandbox.io/s/react-dnd-antd-input-select-issue-gy2hb
重现步骤:
- 使用除 Firefox 之外的任何其他浏览器尝试使用鼠标(而不是箭头键)在输入字段内移动文本光标.结果 - 光标/指针将根据您点击的位置移动.
- 使用 Firefox 尝试做同样的事情.结果 - 无论您在输入字段内点击何处,光标/指针都不会移动.
预期结果:无论浏览器如何,光标/指针都应该移动
Expected Outcome: The cursor/pointer should move regardless of the browser
我需要在 Firefox 上使用它,因为我正在处理一个重要项目.
I need this to work on Firefox as I am working on an Important Project.
推荐答案
我有同样的问题和这个评论 here 帮我解决了这个问题.希望它也能帮到你.
I had the same issue and this comment here helped me to solve it. Hope it helps you as well.
这篇关于Ant Design Input/React DND - 使用 react-dnd 时无法在 Ant Design Input 内移动文本指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!