universal-api icon indicating copy to clipboard operation
universal-api copied to clipboard

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

Open XESDog opened this issue 3 years ago • 1 comments

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

系统: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 avatar Mar 22 '22 09:03 XESDog

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

改成这样就好了~

XESDog avatar Mar 22 '22 09:03 XESDog