raxjs / universal-api

Universal apis for web and miniapps.
https://universal-api.js.org/
266 stars 63 forks source link

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

Open XESDog opened 2 years ago

XESDog commented 2 years ago

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

系统: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 commented 2 years ago

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

改成这样就好了~