ionic - 在iOS 10的输入字段中复制/粘贴不起作用

时间:2021-08-14 19:01:18

As the title suggests, I am building a project with ionic and I am not able to copy/paste in the input fields on iOS 10. According to this question, by applying these properties to the css the issue should be solved:

正如标题所示,我正在构建一个带有离子的项目,我无法在iOS 10的输入字段中复制/粘贴。根据这个问题,通过将这些属性应用于css,问题应该得到解决:

 input {
    user-select: auto !important;  
 } 

but unluckily it is still not working. As also suggested by this reference, it says that it may be caused by $ionicLoading, but I am not using it inside my controller.

但不幸的是它仍然无法正常工作。正如此引用所暗示的那样,它可能是由$ ionicLoading引起的,但我并没有在我的控制器中使用它。

Do you know how to solve this issue? Thanks in advance for your replies!

你知道如何解决这个问题吗?提前感谢您的回复!

3 个解决方案

#1


6  

I was not able to understand your problem.

我无法理解你的问题。

But if you want it to be really working, you can try it.

但如果你想让它真正起作用,你可以尝试一下。

Install cordova-plugin-clipboard

安装cordova-plugin-clipboard

var text = "Hello World!";

var text =“Hello World!”;

cordova.plugins.clipboard.copy(text);

cordova.plugins.clipboard.copy(文本);

cordova.plugins.clipboard.paste(function (text) { alert(text); });

cordova.plugins.clipboard.paste(function(text){alert(text);});

#2


3  

Are you using an ion-spinner?

你在使用离子旋转器吗?

Just going off the following github thread:

刚刚关闭以下github线程:

https://github.com/driftyco/ionic/issues/3793

https://github.com/driftyco/ionic/issues/3793

#3


3  

Instead of just typing user-select: auto !important;

而不是只输入user-select:auto!important;

As in this answer try adding all css to the element instead of just that empty line that might not work on all browsers.

正如在这个答案中尝试将所有css添加到元素而不是只是可能不适用于所有浏览器的空行。

Here:

这里:

    -webkit-user-select: auto !important;
    -khtml-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    -o-user-select: auto !important;
    user-select: auto !important;

#1


6  

I was not able to understand your problem.

我无法理解你的问题。

But if you want it to be really working, you can try it.

但如果你想让它真正起作用,你可以尝试一下。

Install cordova-plugin-clipboard

安装cordova-plugin-clipboard

var text = "Hello World!";

var text =“Hello World!”;

cordova.plugins.clipboard.copy(text);

cordova.plugins.clipboard.copy(文本);

cordova.plugins.clipboard.paste(function (text) { alert(text); });

cordova.plugins.clipboard.paste(function(text){alert(text);});

#2


3  

Are you using an ion-spinner?

你在使用离子旋转器吗?

Just going off the following github thread:

刚刚关闭以下github线程:

https://github.com/driftyco/ionic/issues/3793

https://github.com/driftyco/ionic/issues/3793

#3


3  

Instead of just typing user-select: auto !important;

而不是只输入user-select:auto!important;

As in this answer try adding all css to the element instead of just that empty line that might not work on all browsers.

正如在这个答案中尝试将所有css添加到元素而不是只是可能不适用于所有浏览器的空行。

Here:

这里:

    -webkit-user-select: auto !important;
    -khtml-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    -o-user-select: auto !important;
    user-select: auto !important;