-
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
feat(input): add autosize for textarea component, update document, and website demo #461
Conversation
it('should trigger onChange when input event happens', () => { | ||
let val = ''; | ||
const wrapper = mount(<Input.TextArea onChange={e => (val = e.target.value)} />); | ||
expect(wrapper.render()).toMatchSnapshot(); |
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.
这里为啥用快照
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.
修改完代码有时候第一次创建组件时就和之前的快照不一样,确保后面的快照是基于本次的快照变动,有时候报错只是快照文件还是老的
| ... | 支持其他 React 自带的 input 属性 | any | - | | ||
|
||
### Input.Password | ||
|
||
| 参数 | 说明 | 类型 | 默认值 | | ||
| ------------ | -------------------------------- | -------------------------- | -------- | | ||
| value | 值 | string | 必填 | | ||
| onChange | 修改值时触发的回调函数 | Function(value: 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.
这里为啥下掉
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.
password之前就是接受 ChangeEvent 事件,而不是string,只有inputNumber是,所以去掉错的,同上还是合并到“支持其他 React 自带的 input 属性”
@@ -31,31 +31,34 @@ group: | |||
| 参数 | 说明 | 类型 | 默认值 | | |||
| ------------ | -------------------------------- | -------------------------- | -------- | | |||
| value | 值 | string | 必填 | | |||
| onChange | 修改值时触发的回调函数 | Function(value: 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.
这里
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.
onChange现在是和react本身的onChange一样的参数,所以就不单独列出,合并到“支持其他 React 自带的 input 属性”里
@@ -79,11 +83,12 @@ group: | |||
| 参数 | 说明 | 类型 | 默认值 | | |||
| ----------- | ----------------------------------- | ----------------------- | ------ | | |||
| value | 值 | string | 必填 | | |||
| onChange | 修改值时触发的回调函数 | Function(value: 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.
这里
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.
同上
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/growingio/gio-design/f94aeamn8 |
Codecov Report
@@ Coverage Diff @@
## master #461 +/- ##
==========================================
+ Coverage 76.83% 76.91% +0.08%
==========================================
Files 114 114
Lines 3665 3678 +13
Branches 871 877 +6
==========================================
+ Hits 2816 2829 +13
Misses 844 844
Partials 5 5
Continue to review full report at Codecov.
|
Deploy preview for ready! ✅ https://deploy-preview-461--gio-design.surge.sh |
@gio-design/package