Skip to content

Feature: Turning datepicker into a controlled component #4

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

Merged
merged 3 commits into from
Jul 31, 2018

Conversation

arthurdenner
Copy link
Owner

@arthurdenner arthurdenner commented Jul 31, 2018

What kind of change does this PR introduce?
You can now use onDateChange and selected props to control the datepicker, just like you would use onChange and value in an input element.

Also, it adds a default prop to firstDayOfWeek and a z-index to the calendar component.

What is the current behavior?
The state of the datepicker is not updated when a new selected prop is provided.

What is the new behavior?
When a new selected prop is provided, the datepicker recalculates its state.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@codecov-io
Copy link

Codecov Report

Merging #4 into master will decrease coverage by 0.16%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #4      +/-   ##
=========================================
- Coverage   10.12%   9.95%   -0.17%     
=========================================
  Files          13      13              
  Lines         237     241       +4     
  Branches       44      45       +1     
=========================================
  Hits           24      24              
- Misses        173     176       +3     
- Partials       40      41       +1
Impacted Files Coverage Δ
src/components/datepicker.js 0% <0%> (ø) ⬆️

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 014cb44...6b0fec3. Read the comment docs.

@arthurdenner arthurdenner merged commit 755bf87 into master Jul 31, 2018
@arthurdenner arthurdenner deleted the feature/datepicker-controlled branch September 10, 2018 18:50
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