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

feat(input): add autosize for textarea component, update document, and website demo #461

Merged
merged 8 commits into from
Nov 12, 2020
Merged

feat(input): add autosize for textarea component, update document, and website demo #461

merged 8 commits into from
Nov 12, 2020

Conversation

HunterGitHub
Copy link
Contributor

@gio-design/package

  • Input, Textarea
    • add autosize prop for textarea component,
    • format code in the input
    • update document with the latest props list
    • add more features in the website demos

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥用快照

Copy link
Contributor Author

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) | 必填 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥下掉

Copy link
Contributor Author

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) | 必填 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里

Copy link
Contributor Author

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) | 必填 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@vercel
Copy link

vercel bot commented Nov 12, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/growingio/gio-design/f94aeamn8
✅ Preview: https://gio-design-git-fix-docupdate.growingio.vercel.app

@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #461 (2fe8d94) into master (44de027) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
...kages/components/src/components/input/TextArea.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44de027...cf7f308. Read the comment docs.

@azure-pipelines
Copy link

Deploy preview for ready! ✅ https://deploy-preview-461--gio-design.surge.sh

@gavin-hao gavin-hao merged commit 0d540fa into growingio:master Nov 12, 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.

3 participants