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

[bug fix] Select: return selected data instead of invoking setState in traverseData #1337

Merged
merged 35 commits into from Feb 5, 2020
Merged

[bug fix] Select: return selected data instead of invoking setState in traverseData #1337

merged 35 commits into from Feb 5, 2020

Conversation

wjw99830
Copy link
Collaborator

@wjw99830 wjw99830 commented Feb 1, 2020

原因:traverseData使用了setState更新状态,构造函数中调用traverseData时setState是个noop,因此会导致首次渲染时selectedItem为空

改动:traverseData函数改为返回已选中的项目,内部不调用setState

wangjiwei and others added 26 commits November 14, 2019 15:47
* 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>
@wjw99830 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 cpylua merged commit ffe5acd into youzan:master Feb 5, 2020
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.

None yet

4 participants