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
merged 2 commits into from Aug 28, 2018

Conversation

Projects
None yet
3 participants
@sbusch
Contributor

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.
@ant-design-bot

This comment has been minimized.

ant-design-bot commented Aug 27, 2018

Deploy preview for ant-design ready!

Built with commit 667636d

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

@codecov

This comment has been minimized.

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.

@afc163

This comment has been minimized.

Member

afc163 commented Aug 27, 2018

Could you add a test case?

@sbusch

This comment has been minimized.

Contributor

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).

@afc163

This comment has been minimized.

Member

afc163 commented Aug 27, 2018

Checking select function existed would be enough.

@sbusch

This comment has been minimized.

Contributor

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

20 checks passed

WIP ready for review
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 92.19%)
Details
codecov/project 92.19% (+<.01%) compared to 5e31067
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@sbusch sbusch deleted the sbusch:input-select-method branch Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment