-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: allow use value control selections; #317
Conversation
affects: @gio-design/components, website
Deploy preview for gio-design failed. |
affects: @gio-design/components
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
==========================================
- Coverage 56.68% 56.59% -0.09%
==========================================
Files 105 105
Lines 3315 3320 +5
Branches 796 799 +3
==========================================
Hits 1879 1879
- Misses 1432 1437 +5
Partials 4 4
Continue to review full report at Codecov.
|
Deploy preview for ready! ✅ https://deploy-preview-317--gio-design.surge.sh |
const [selection, _setSelection] = useState( | ||
new Set(Array.isArray(defaultSelection) ? defaultSelection : [defaultSelection]) | ||
); | ||
const [_selection, _setSelection] = useState(new Set(concat<string>([], defaultValues))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议直接使用 es6 的 展开运行符 [... defaultValues]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
传入值是 string | string[] 没办法直接展开吧 这里是逻辑是把string转换成 string[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
了解了。好多地方都有同样的逻辑,我们应该可以提供一个通用的方法
@@ -123,6 +123,7 @@ | |||
display: inline-block; | |||
width: auto; | |||
max-width: 100%; | |||
height: auto !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥为加 !important
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
被别的组件里 .gio-input覆盖了 input的坑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有的组件没封装 我这个封在这个组件的scope里了
affects: @gio-design/components
Deploy preview for ready! ✅ https://deploy-preview-317--gio-design.surge.sh |
* feat: add grid * feat: add test cases affects: @gio-design/components, website * fix: make ts happy again * chore: revert yarn.lock file * chore: remove package-lock.json * fix: typo * feat: time-picker (#292) * update: style * chore: time-picker * fix: clear log Co-authored-by: chen_gh <chenguanghao@growingio.com> * feat(searchbar): add placeholder prop (#290) affects: @gio-design/components * refactor(table): define when dataSource update, pagination behaviour (#295) affects: @gio-design/components * feat(date-picker): add rengePicker feature (#296) affects: @gio-design/components, website add rangePicker adds a new parameter for the renderExtraFooter method to return a React.ReactNode to add a custion footer.fix rangePicker change the date or the date displayed in the year does not change. fix rangePicker onSelect method is invalid * docs: @gio-design/components 20.10.0 change log (#306) * docs: @gio-design/components 20.10.0 change log * docs: @gio-design/components 20.10.0 change log * docs: @gio-design/components 20.10.1 change log (#309) affects: @gio-design/components, @gio-design/icons, @gio-design/tokens, website fix changelog and version numbers; * docs: @gio-design/components 20.10.2 change log affects: @gio-design/components, @gio-design/icons, website * docs: update version number affects: website * fix: time-picker style (#307) Co-authored-by: chen_gh <chenguanghao@growingio.com> * feat(date-picker): add dateRangePicker disabledDate methods (#314) affects: @gio-design/components, website daa dateRangePicker disabledDate methods and fix props.value change is not change Input value ISSUES CLOSED: #304 * fix: allow use value control selections; (#317) * fix: allow use value control selections; affects: @gio-design/components, website * fix: fix type bug affects: @gio-design/components * fix: modify defaultSelection as default value of defaultValue affects: @gio-design/components * style(form): 根据stylelint的提示,修改了form组件中index.less中部分属性的顺序 (#318) affects: @gio-design/components 根据stylelint的提示,修改了form组件中index.less中部分属性的顺序 * fix select text overflow and add icons (#319) * fix: fix overflow text elips affects: @gio-design/components * fix: add iconns affects: @gio-design/icons * docs: @gio-design/components 20.10.3 change log (#320) affects: @gio-design/components, @gio-design/icons, website * docs: @gio-designs/components release-20.10.4 change log (#322) affects: @gio-design/components, @gio-design/icons, website replace 20.10.3 empty package * feat: add grid * feat: add test cases affects: @gio-design/components, website * fix: make ts happy again * chore: revert yarn.lock file * chore: remove package-lock.json * fix: typo * fix(upload): upload组件增加一个可选参数isBorder,控制图片上传成功后边框是否显示 (#331) affects: @gio-design/components, website Upload组件增加一个可选参数isBorder,控制图片上传成功后边框是否显示,默认为false * chore: create release pull request template * chore: delete old pull request template * chore: create feature or fix pull request template * fix(dropdown): 修复Dropdown组件中placement方向的问题,由12个方向改为只有上下6个方向可选,默认方向为下 (#333) affects: @gio-design/components, website 修复Dropdown组件中placement方向的问题,由12个方向改为只有上下6个方向可选,默认方向为下 * style(select): 定义了select组件中input选择框内的文字尺寸 (#337) affects: @gio-design/components 定义了select组件中input选择框内的文字尺寸 * test(alert): unit test of alert component is added (#339) affects: @gio-design/components Unit test of alert component is added * fix(components): change folder name from camel case to kebab case (#329) * fix(components): change folder name from camel case to kebab case affects: @gio-design/components * fix(components): fix tab-nav folder name affects: @gio-design/components, website * fix: index time-picker Co-authored-by: G_H <gh_c@qq.com> Co-authored-by: chen_gh <chenguanghao@growingio.com> Co-authored-by: Lee Hon <lihang@growingio.com> Co-authored-by: cnsummer <31471551+cnsummer@users.noreply.github.com> Co-authored-by: zhaoting zhou <zhouzhaoting@growingio.com> Co-authored-by: WORLDI <66404428+WORLDI@users.noreply.github.com> Co-authored-by: Jack <panjie@growingio.com> Co-authored-by: phyzess <phyzess@gmail.com>
affects: @gio-design/components, website
Related issue link
需要list支持value受控 #250
#303
#278
Changelog
Self check