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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Not block input when Input value is undefined #20783

Merged
merged 5 commits into from Jan 9, 2020
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jan 9, 2020

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

fix #20776

馃挕 Background and solution

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English Input not block user input when value is undefined.
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Could you please add tests to make sure this change works as expected?

@codesandbox-ci
Copy link

@codesandbox-ci codesandbox-ci bot commented Jan 9, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e59301f:

Sandbox Source
antd reproduction template Configuration
antd-input-4 Issue #20776
antd-input-3 Issue #20776

@netlify
Copy link

@netlify netlify bot commented Jan 9, 2020

Deploy preview for ant-design ready!

Built with commit e59301f

https://deploy-preview-20783--ant-design.netlify.com

@afc163
Copy link
Member

@afc163 afc163 commented Jan 9, 2020

Select and Input controlled mode have breaking change in v4 that we should report it in ChangeLog.

};
static getDerivedStateFromProps(nextProps: InputProps, { prevValue }: InputState) {
const newState: Partial<InputState> = { prevValue: nextProps.value };
if (nextProps.value !== undefined || prevValue !== nextProps.value) {
Copy link
Member

@afc163 afc163 Jan 9, 2020

Choose a reason for hiding this comment

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

娌′粈涔堝繀瑕佹瘮杈冿紝鏁翠釜 constructor 搴旇閮藉彲浠ュ垹鎺夈

Copy link
Member Author

@zombieJ zombieJ Jan 9, 2020

Choose a reason for hiding this comment

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

鎴戜滑鐨 Table customize 渚嬪瓙閲岄噸缃槸鎶 filter value 鏁扮粍浠 [e.target.value] 鏀规垚 []锛屽畠浼氬彉鎴 undefined 鎴愪负闈炲彈鎺фā寮忋傝繖浼 break 鎺夊師鏈殑琛屼负銆傛墍浠ョ壒鍦板姞涓涓垽鏂紝濡傛灉鏄煎彉鍖栵紝鎬绘槸瑙﹀彂涓涓嬨

Copy link
Member

@afc163 afc163 Jan 9, 2020

Choose a reason for hiding this comment

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

杩欎釜 break change 鍦ㄧ敤鎴蜂唬鐮侀噷鐨勭粏鑺傚緢澶氾紝鎴戜滑浼氶亣鍒扮殑璇濈敤鎴蜂篃浼氾紝鑰冭檻涓涓嬫槸涓嶆槸鍙互涓 break銆

Copy link
Member Author

@zombieJ zombieJ Jan 9, 2020

Choose a reason for hiding this comment

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

鐜板湪鍞竴鐨 breaking change 灏辨槸 undefined 涓洪潪鍙楁帶锛屽叾浠栫殑鎯呭喌鍒囨崲閮芥槸鍙楁帶銆傝冭檻鐨勬儏鍐靛簲璇ユ槸姣旇緝鍏ㄩ潰鐨勪簡銆

Copy link
Member

@afc163 afc163 Jan 9, 2020

Choose a reason for hiding this comment

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

馃憣锛岃嚦灏 undefined 鏃跺彈鎺ф敼涓嶅彈鎺э紝涓嶄細鍑虹幇鐢ㄦ埛鏃犳硶杈撳叆鐨勯棶棰橈紝杩欎釜鍙兘寮曞彂鐨勯棶棰樿繕鏄瘮杈冨皬鐨勩

@afc163 afc163 removed the chore label Jan 9, 2020
@codecov
Copy link

@codecov codecov bot commented Jan 9, 2020

Codecov Report

Merging #20783 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20783      +/-   ##
==========================================
+ Coverage   97.46%   97.47%   +<.01%     
==========================================
  Files         296      296              
  Lines        6877     6878       +1     
  Branches     1912     1865      -47     
==========================================
+ Hits         6703     6704       +1     
  Misses        174      174
Impacted Files Coverage 螖
components/input/ClearableLabeledInput.tsx 100% <酶> (酶) 猬嗭笍
components/input/Input.tsx 100% <100%> (酶) 猬嗭笍

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 313c8f9...e59301f. Read the comment docs.

@zombieJ zombieJ merged commit 05ebf0f into master Jan 9, 2020
31 checks passed
@zombieJ zombieJ deleted the input-control branch Jan 9, 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.

2 participants