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

Taro.setClipboardData 复制内容,不能复制换行,看了下源码使用的是input而不是textarea,换成textarea就能复制换行的内容 #8802

Closed
ShaoGongBra opened this issue Mar 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@ShaoGongBra
Copy link
Contributor

这个特性解决了什么问题?

Taro.setClipboardData h5端不能复制换行

这个 API 长什么样?

Taro.setClipboardData 能复制换行

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Mar 3, 2021
@ShaoGongBra ShaoGongBra changed the title Taro.setClipboardData 复制内容,不能复制换行,看了下源码使用的是input而不是textaarea,换成textarea就能复制换行的内容 Taro.setClipboardData 复制内容,不能复制换行,看了下源码使用的是input而不是textarea,换成textarea就能复制换行的内容 Mar 3, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 5, 2021

请使用提报 bug 的 Issue 模板重新提交,并提供相应的可复现 demo

@Chen-jj Chen-jj closed this as completed Mar 5, 2021
@ShaoGongBra
Copy link
Contributor Author

ShaoGongBra commented Mar 5, 2021

要提供demo太复杂了,就是找个文件
node_modules@tarojs\taro-h5\src\api\clipboard\index.js:55

const input = document.createElement('input')
替换为
const input = document.createElement('textarea')

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

No branches or pull requests

2 participants