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

Input: new method select(), passed to underlying input #11906

merged 2 commits into from Aug 28, 2018


Copy link

@sbusch sbusch commented Aug 27, 2018

New method select which is passed on to the underlying input element. Similar to focus and blur.

Added no documentation and no demo because focus and blur weren't documented/demoed.

Side question: the underlying input is stored in input member variable. This variable isn't officially documented, but defined in TypeScript interface. So is accessing it from outside officially supported and safe, or is this an unsupported feature?

  • Make sure that you propose PR to right branch: bugfix for master, feature for latest active branch feature-x.x.
  • Make sure that you follow antd's code convention.
  • Run npm run lint and fix those errors before submitting in order to keep consistent code style.
  • Rebase before creating a PR to keep commit history clear.
  • Add some descriptions and refer relative issues for you PR.
  • Extra checklist for isNewFeature :
    • Update API docs for the component.
    • Update/Add demo to demonstrate new feature.
    • Update TypeScript definition for the component.
    • Add unit tests for the feature.

Copy link

ant-design-bot commented Aug 27, 2018

Deploy preview for ant-design ready!

Built with commit 667636d

Copy link

codecov bot commented Aug 27, 2018

Codecov Report

Merging #11906 into feature-3.9.0 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##           feature-3.9.0   #11906      +/-   ##
+ Coverage          92.19%   92.19%   +<.01%     
  Files                206      206              
  Lines               5395     5397       +2     
  Branches            1512     1512              
+ Hits                4974     4976       +2     
  Misses               417      417              
  Partials               4        4
Impacted Files Coverage Δ
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 5e31067...667636d. Read the comment docs.

Copy link

afc163 commented Aug 27, 2018

Could you add a test case?

Copy link
Contributor Author

sbusch commented Aug 27, 2018

@afc163 I thought about that, but what should be tested? I could check via selection API if the whole text is selected after select, but then I would have to expose even more methods..

Or - see "side question" above - we should document input as an official feature, which my tests could use (I would keep select() exposed as a convenience method).

Copy link

afc163 commented Aug 27, 2018

Checking select function existed would be enough.

Copy link
Contributor Author

sbusch commented Aug 28, 2018

Just added the test.

Do you / does anyone have an opinion on the "input" member variable?

I need to know this because I need the button to expose a focus() method. I will submit an PR for this after this PR here is done. Depending on an "official" reasoning on such reference member vars, I would introduce (and document) such a member variable for Button aswell.

@afc163 afc163 merged commit d47a5be into ant-design:feature-3.9.0 Aug 28, 2018
@sbusch sbusch deleted the input-select-method branch August 28, 2018 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants