如何让我的 Ionic 4 应用程序长按 select 文本?
How can I get my Ionic 4 app to long-press select text?
我的 Ionic 4 应用程序需要处理 iOS 上的长按文本 select/copy/paste。
我在 global.scss 中尝试了以下方法但没有成功:
* {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}
并创建一个可以包含在每个元素中的 class:
.selectable {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
然后
<div class='selectable'>This should be selectable</div>
None 个有效。
对我做错了什么有什么建议吗?
.text-select {
-webkit-user-select: auto;
}
然后在您想要的特定元素上使用 class。下面的示例
<ion-text class="text-select">Test</ion-text>
我的 Ionic 4 应用程序需要处理 iOS 上的长按文本 select/copy/paste。
我在 global.scss 中尝试了以下方法但没有成功:
* {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}
并创建一个可以包含在每个元素中的 class:
.selectable {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
然后
<div class='selectable'>This should be selectable</div>
None 个有效。
对我做错了什么有什么建议吗?
.text-select {
-webkit-user-select: auto;
}
然后在您想要的特定元素上使用 class。下面的示例
<ion-text class="text-select">Test</ion-text>