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
[bug fix] Select: return selected data instead of invoking setState in traverseData #1337
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* fix: IFormSelectFieldProps['name'] should be inferred correctly * feat: Cascader pass raw option when onChange emitted * test: add test suite for Cascader * chore: sync to master * chore: add default generic type for Cascader
* fix: IFormSelectFieldProps['name'] should be inferred correctly * fix: 修复Form组件的form属性类型 * fix: 修改IFormProps泛型 * fix: change OmitKeys default generic type * fix: use IFormFieldPropsBase for intellisense * chore: sync to master
* save * new component Waypoint * add license * add reveal demo * rewrite Affix using Waypoint * remove affix test * rewrite InfiniteLoading with Waypoint * fire onLeave on mount in Waypoint
* fix: IFormSelectFieldProps['name'] should be inferred correctly * chore: sync to master * fix: Form组件的layout属性改为可选属性
* wrap text in span in Button * save * add Dropdown * fix crash if no children is passed to button
* support default preset in quick-date-range-picker * check type * remove prefix and fix types * fix tests * add tests
* fix: upload 组件 classname 前缀修改 * fix: 修复删除上传项时 maxPage 计算错误的 bug
* grid: 添加表头吸顶 * grid: 修复grid表头吸顶在垂直方向不滚动是异常 * grid: grid组件checkbox 禁用添加pop展示禁用原因 * grid: 补充文档 * grid: 优化grid表头吸顶 * grid: 更新表头吸顶示例 * grid: 优化ref绑定 * grid: 默认值修改为undefined * grid: 表头吸顶交互优化 * remove console.log Co-authored-by: Charles Lee <cpylua@users.noreply.github.com>
…instead of invoking setState
wjw99830
changed the title
[bug fix] Select: return selected data instead of invoke setState in traverseData
[bug fix] Select: return selected data instead of invoking setState in traverseData
Feb 1, 2020
cpylua
reviewed
Feb 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
原因:traverseData使用了setState更新状态,构造函数中调用traverseData时setState是个noop,因此会导致首次渲染时selectedItem为空
改动:traverseData函数改为返回已选中的项目,内部不调用setState