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组件清除不了内容 #1837

Closed
sage-z opened this issue Jan 7, 2019 · 3 comments
Closed

小程序Input组件清除不了内容 #1837

sage-z opened this issue Jan 7, 2019 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@sage-z
Copy link
Contributor

sage-z commented Jan 7, 2019

  1. onInput 事件中返回覆盖不了input控件里的值
  2. onInput 事件中没有confirm类型,用来判断输入完成后清空文字
import {  View,  Input } from "@tarojs/components";

  onConfirm = data => {
    // const { value } = data.detail
    console.log(data)
    return ""
    // this.props.dispatch({type:'dot/add', payload: value})

  }

  onInput (e) {
    console.log(e)
    return ""
  }

  render() {
    return (
<Input 
       confirmHold 
       onInput={this.onInput.bind(this)} 
       focus={this.state.focus} 
       onFocus={this.onFocus.bind(this)} 
       onConfirm={this.onConfirm.bind(this)} 
      /> )}

👽 Taro v1.2.4

Taro CLI 1.2.4 environment info:
System:
OS: macOS 10.14.2
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.12.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: 1.2.4 => 1.2.4
@tarojs/cli: 1.2.4 => 1.2.4
@tarojs/components: 1.2.4 => 1.2.4
@tarojs/plugin-babel: 1.2.4 => 1.2.4
@tarojs/plugin-csso: 1.2.4 => 1.2.4
@tarojs/plugin-sass: 1.2.4 => 1.2.4
@tarojs/plugin-uglifyjs: 1.2.4 => 1.2.4
@tarojs/redux: 1.2.4 => 1.2.4
@tarojs/router: 1.2.4 => 1.2.4
@tarojs/taro: 1.2.4 => 1.2.4
@tarojs/taro-h5: 1.2.4 => 1.2.4
@tarojs/taro-weapp: 1.2.4 => 1.2.4
@tarojs/webpack-runner: 1.2.4 => 1.2.4
eslint-config-taro: 1.2.4 => 1.2.4
eslint-plugin-taro: 1.2.4 => 1.2.4
npmGlobalPackages:
typescript: 3.1.3

@taro-bot
Copy link

taro-bot bot commented Jan 7, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@sage-z
Copy link
Contributor Author

sage-z commented Jan 8, 2019

需要什么补充信息吗

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 10, 2019

@sage-z

  1. CLI 和依赖都升级到最新版再试试,最新版本上可以成功清除。

  2. 没看懂什么是 “onInput 事件中没有confirm类型”

@Chen-jj Chen-jj added answered question Further information is requested labels Apr 10, 2019
@Chen-jj Chen-jj closed this as completed Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants