1

我在输入只读且有占位符文本的文本时遇到问题。我无法复制 chrome 中的文本。

  • 如果用鼠标选择文本,然后按 CTRL + C,则不会复制文本
  • 如果双击文本,然后按 CTRL + C,则复制文本
  • 如果双击鼠标并在鼠标上下文菜单中选择要复制的选项,则复制文本

<p>If the text is selected with the mouse and then CTRL + C, the text is not copied</p>
<p>If the text is double-clicked and then CTRL + C, the text is copied</p>
<p>
If the text with double click of mouse and in the context menu of the mouse is selected the option to copy, the text is copied</p>


<form>
<input type="text" value="123" placeholder="123" readonly="readonly"/></form>

提琴手:https ://jsfiddle.net/sjtwdov3/26/

我尝试搜索此问题,但找不到任何帮助。你遇到过这种情况吗?这是一个已知的 chrome 问题吗?

4

1 回答 1

0

已编辑 - 由于它是通过表单传递的,因此使用下面的隐藏字段和 name 属性来通过表单传递值。

<input type="text" value="123" placeholder="123" disabled />
<input type="hidden" value="123" name="fieldName" />
于 2018-08-27T17:10:04.873 回答