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

Input非受控组件进行粘贴时,粘贴内容无法更新 #8862

Closed
shenX-2021 opened this issue Mar 10, 2021 · 0 comments
Closed

Input非受控组件进行粘贴时,粘贴内容无法更新 #8862

shenX-2021 opened this issue Mar 10, 2021 · 0 comments
Labels
T-h5 Target - 编译到 H5 V-2 Version - 2.x

Comments

@shenX-2021
Copy link

shenX-2021 commented Mar 10, 2021

相关平台

H5

浏览器版本: Chrome版本 88.0.4324.190(正式版本) (64 位)
使用框架: React

复现步骤

1、创建受控Input组件
2、复制一段文本
3、输入一段文字,保持组件聚焦,粘贴
4、提交表单

期望结果

能正常粘贴文本

实际结果

粘贴文本在上述情况会丢失

环境信息

� Taro v2.2.14

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

  Taro CLI 2.2.14 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.16.3 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - D:\Program Files\Yarn\bin\yarn.CMD
      npm: 6.14.4 - D:\Program Files\nodejs\npm.CMD


补充信息

Input组件的onInputExcuted属性在用户输入时,触发onKeyDown事件被设为false,在onInput事件onInputExcuted为false是可以正常赋值的,并且将onInputExcuted设为true。因此输入停止后,onInputExcuted值为true,不可被赋值,粘贴的操作就被拦截了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-h5 Target - 编译到 H5 V-2 Version - 2.x
Projects
Archived in project
Development

No branches or pull requests

2 participants