Skip to content

fix: 使用react-native-material-textfield组件使用vaule属性异常 #5

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

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

panda12530
Copy link

@panda12530 panda12530 commented Jul 26, 2024

Summary

  • 这个 PR 解决了哪些 issues?请标记这些 issues,以便合并 PR 后这些 issues 将会被自动关闭。
    Closes fix: 使用react-native-material-textfield组件使用vaule属性异常 #4
  • 这个功能是什么?(如果适用)
    react-native-material-textfield组件vaule属性无法重新设置文本
  • 您是如何实现解决方案的?
    问题定位:react-native-material-textfield\src\components\field文件下面的index.js
    value() {
    let { text } = this.state;
    let { defaultValue } = this.props;
    let value = this.isDefaultVisible()?
    defaultValue:
    text; ---------日志定位,这个text值没有变化
    ...
    }
    重新设置value属性时日志定位text值没有变化
    解决方案:
    value() {
    let { text } = this.state;
    let { defaultValue } = this.props;
    let value = this.isDefaultVisible()?
    defaultValue:
    this.props.value;
    ...
    }
    修改后value属性可以获取值

Test Plan

展示代码的稳定性。例如:用来复现场景的命令输入和结果输出、测试用例的路径地址,或者附上截图和视频。
测试用例地址:https://github.com/MyAndroidNetZWJ/RNOHDCS/tree/main/react-native-material-dropdown

Checklist

  • 已经在真机设备或模拟器上测试通过
  • 已经与 Android 或 iOS 平台做过效果/功能对比
  • 已经添加了对应 API 的测试用例(如需要)
  • 已经更新了文档(如需要)
  • 更新了 JS/TS 代码 (如有)

@panda12530 panda12530 closed this Jul 26, 2024
@panda12530 panda12530 reopened this Jul 26, 2024
@Magic-Neko Magic-Neko merged commit 7f6dd98 into react-native-oh-library:sig Jul 26, 2024
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

Successfully merging this pull request may close these issues.

fix: 使用react-native-material-textfield组件使用vaule属性异常
2 participants