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

Pass id prop to DatePicker input field #8598

Merged
merged 1 commit into from Jan 24, 2018

Conversation

mgrdevport
Copy link
Contributor

This PR passes the DatePicker prop id to the rendered input field as requested in #8305.

@codecov
Copy link

codecov bot commented Dec 13, 2017

Codecov Report

Merging #8598 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8598   +/-   ##
=======================================
  Coverage   85.25%   85.25%           
=======================================
  Files         195      195           
  Lines        4674     4674           
  Branches     1378     1378           
=======================================
  Hits         3985     3985           
  Misses        689      689
Impacted Files Coverage Δ
components/date-picker/WeekPicker.tsx 78.72% <ø> (ø) ⬆️
components/date-picker/interface.tsx 0% <ø> (ø) ⬆️
components/date-picker/RangePicker.tsx 94.69% <ø> (ø) ⬆️
components/date-picker/createPicker.tsx 92.59% <ø> (ø) ⬆️

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 cdb160a...9e42be9. Read the comment docs.

@benjycui
Copy link
Contributor

Could you update RangePicker at the same time?

@yesmeck
Copy link
Member

yesmeck commented Dec 14, 2017

@benjycui #8305 (comment)

@benjycui
Copy link
Contributor

benjycui commented Dec 15, 2017

@yesmeck actually.. I just think this could work with label[for]

P.S. we just need to make DatePicker work with onFocus

@yesmeck
Copy link
Member

yesmeck commented Dec 15, 2017

@benjycui 👍

@mgrdevport mgrdevport force-pushed the datepicker branch 2 times, most recently from 6af3191 to 1cc7b87 Compare December 19, 2017 07:12
@mgrdevport
Copy link
Contributor Author

To have the id on the initial input field would help us to write better dom selectors while testing:
findById->focus->findByClass(.ant-calendar-input)->setValue
Better than:
findByClass(.ant-calendar-picker-input)->focus[n]->findByClass(.ant-calendar-input)->setValue

@benjycui
Copy link
Contributor

Conflict....

@mgrdevport
Copy link
Contributor Author

conflicts are resolved, tests are running fine locally. I don't know why the snapshots of collapse are failing on the travis ci build.

@yesmeck
Copy link
Member

yesmeck commented Dec 20, 2017

@mgrdevport Rebase master

@mgrdevport mgrdevport force-pushed the datepicker branch 2 times, most recently from aa75654 to ccd0317 Compare December 20, 2017 19:14
@mgrdevport
Copy link
Contributor Author

@yesmeck Thanks

@@ -267,6 +267,7 @@ export default class RangePicker extends React.Component<any, any> {
disabled={props.disabled}
readOnly
value={(start && start.format(props.format)) || ''}
id={props.id && `${props.id}-start`}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add id in the wrapper, instead inputs..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would mean we would have to search for the first and second input inside the wrapper:
findById(myid)->find(input)[nth]

What do you think of adding an additional id to the wrapper, without the start and end postfix?
findById(myid)->find(input#myid-start)
findById(myid)->find(input#myid-end)

Copy link
Contributor

Choose a reason for hiding this comment

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

@yesmeck What your opinion. I will release a new version soon.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with @benjycui

@yesmeck
Copy link
Member

yesmeck commented Jan 13, 2018

Ping @mgrdevport

@mgrdevport
Copy link
Contributor Author

I've moved the id declaration to the wrapper.

@ddcat1115
Copy link
Contributor

Conflict... Please rebase master again @mgrdevport

@mgrdevport
Copy link
Contributor Author

@ddcat1115 done.

@mgrdevport mgrdevport deleted the datepicker branch February 6, 2018 06:44
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.

None yet

6 participants