Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] @uni/clipboard使用chrome浏览器模拟iphone,setClipboard未生效 #269

Open
XESDog opened this issue Mar 22, 2022 · 1 comment

Comments

@XESDog
Copy link

XESDog commented Mar 22, 2022

这个问题在我很多同事的电脑上都出现,应该不是偶现

系统:mac | window(我同事是window)
chrome 版本99

使用控制台的手机模拟器,选择任意iphone机型,走到关于IOS的判断里,是没有起作用的

···
if (isOS()) {
range = document.createRange();
range.selectNodeContents(textArea);
selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
textArea.setSelectionRange(0, 999999);
} else {
textArea.select();
}
···

@XESDog
Copy link
Author

XESDog commented Mar 22, 2022

if (isOS()) {
range = document.createRange();
range.selectNode(textArea);
selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
} else {
textArea.select();
}

改成这样就好了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant