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 onblur事件触发后,之前有值的再次触发onblur后,就会被设置为空值 #11669

Closed
taoWcode opened this issue Apr 19, 2022 · 1 comment

Comments

@taoWcode
Copy link

taoWcode commented Apr 19, 2022

在RN 端input onblur事件触发后,之前有值的再次触发onblur后,就会被设置为空值@zhiqingchen

Originally posted by @taoWcode in #11473 (comment)

起初以为是form获取值的问题,最终定位到Input。

目前看Input没有绑定onChange或者onInput,在onfocus时,设置值为空值。这个returnValue
this.onFocus = () => {
const { onFocus = noop } = this.props;
// event.detail = { value, height }
const { returnValue } = this.state;
this.tmpValue = returnValue || '';
onFocus({
target: { value: this.tmpValue || '' },
detail: { value: this.tmpValue || '' }
});
};
目前不改源代码的情况。
Input 组件 增加 onInput={e => e.detail.value}可以解决该问题。 版本3.4.4

@taro-bot2
Copy link

taro-bot2 bot commented Apr 19, 2022

您的 Issue 没有按照规范从 Taro Issue Helper 创建,因此会被直接关闭。

维护开源项目是一项非常辛苦的工作,还请多多包涵。
了解为什么这么严格?

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

No branches or pull requests

1 participant