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

Fixes #3723: Calendar does not jump back to today's date when using inline and Today button #3737

Conversation

AthiraKadampatta
Copy link
Contributor

Fixes #3723
The preSelection value was not getting set to today's date on clicking Today button link.
Because of this, isKeyboardSelected was returning true and adding the react-datepicker__day--keyboard-selected class to the already selected date. This resulted in the Today button not jumping to today's date

Before the fix:
Before the fix.webm

After the fix:
After the fix.webm

@martijnrusschen
Copy link
Member

Can we add a test for this behaviour?

@codecov
Copy link

codecov bot commented Aug 28, 2022

Codecov Report

Merging #3737 (c7443e4) into master (1d84d31) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3737      +/-   ##
==========================================
+ Coverage   93.34%   93.47%   +0.12%     
==========================================
  Files          20       20              
  Lines        1352     1363      +11     
  Branches      377      381       +4     
==========================================
+ Hits         1262     1274      +12     
  Misses         27       27              
+ Partials       63       62       -1     
Impacted Files Coverage Δ
src/calendar.jsx 92.97% <100.00%> (+0.11%) ⬆️
src/month.jsx 95.00% <0.00%> (+1.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

…e state when Today button is clicked after clicking any other date
@AthiraKadampatta
Copy link
Contributor Author

Hello @martijnrusschen I have added the test for the fixed behaviour - here
Could you please review?

@AthiraKadampatta AthiraKadampatta changed the title Fixes #3723: Calender does not jump back to today's date when using inline and Today button Fixes #3723: Calendar does not jump back to today's date when using inline and Today button Sep 16, 2022
@AthiraKadampatta
Copy link
Contributor Author

@martijnrusschen Please review

@martijnrusschen martijnrusschen merged commit d52612e into Hacker0x01:master Sep 22, 2022
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this pull request Mar 22, 2023
…ay-click-behaviour

Fixes Hacker0x01#3723: Calendar does not jump back to today's date when using inline and Today button
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.

Calendar does not jump back to correct month when using inline view and today button
2 participants