Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Add options calendarFocus and preventUnnecessaryRefocus #428

Merged

Conversation

lexispike
Copy link
Contributor

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description

Add options to

  • allow specified calendar focus directions ('forwards' or 'backwards') and
  • allow prevention of unnecessary refocus on selection of a date in viewing range (for non-scrolled calendars)

Related Issues: #427 & #268

@kamyar kamyar requested review from burakcan, kamyar and mkg0 as code owners June 10, 2021 23:16
@kamyar
Copy link
Contributor

kamyar commented Jun 10, 2021

Thanks for the fix, I just resolved some conflict and one small comment. :)

@kamyar
Copy link
Contributor

kamyar commented Jun 14, 2021

Can you kindly add two small gifs demoing the old and new way this behaves also to the PR description?
Please let me know if you need any help

@AnderUstarroz
Copy link

AnderUstarroz commented Jul 20, 2021

Will this PR be merged anytime soon? If the new preventSnapRefocus flag prevents the "weird" effect of changing the month when selecting the start date (ongoing issue 427), this will bring joy to many people.

lexispike and others added 2 commits July 28, 2021 15:04
Co-authored-by: kamyar <932743+kamyar@users.noreply.github.com>
@lexispike
Copy link
Contributor Author

https://jmp.sh/2leh8i8 GIF of example calendar with new options :)

@lexispike lexispike requested a review from kamyar July 28, 2021 19:10
@lexispike
Copy link
Contributor Author

Sorry for the delay on this, should be good to go!

@lexispike
Copy link
Contributor Author

Also, a before (or with preventSnapRefocus disabled): https://jmp.sh/dkpptq0
after (with it enabled, a longer gif): https://jmp.sh/VoZMDET

@kamyar
Copy link
Contributor

kamyar commented Aug 29, 2021

Thank you for the contribution and addressing the comments! 🎉
I will try to cut a release today 🤞 :octocat:

@kamyar kamyar merged commit d7e32b6 into hypeserver:master Aug 29, 2021
@kamyar
Copy link
Contributor

kamyar commented Aug 29, 2021

(Also sorry for the delay in coming back to this, has been a busy 1-2 months 😓 , thank you for the patience)

@lucasNeuhauss
Copy link

Hi.
Will there be a new npm version release applying these changes soon? Looking forward to it.
Thanks.

@kamyar
Copy link
Contributor

kamyar commented Sep 9, 2021

Hey, sorry did not get a chance to do it last weekend.
I plan to do this weekend, but if anyone would like to get involved, these are the changes needed: https://github.com/hypeserver/react-date-range/pull/497/files

  • bump to 1.4.0
  • update changelog file
    Feel free to open a PR and I can review, approve, merge & trigger push

@kamyar kamyar mentioned this pull request Sep 11, 2021
@kamyar
Copy link
Contributor

kamyar commented Sep 11, 2021

Hey all,
v1.4.0 is released ✨, please take a look and let us know if you see something out of place.
Have a nice weekend!

@AnderUstarroz
Copy link

Working great! Thanks @lexispike, thanks @kamyar.

@cameronbraid
Copy link

You guys rock, this is something that has bugged me a lot

@AnderUstarroz
Copy link

This is still an ongoing issue @kamyar. Please have a look at the the following scenario :

  • On mobile, displaying a single month.
  • Click the start date as the last day of the month.
  • Click the end date as the first day of the next month.

Expected outcome
Stays on the next month.

Actual outcome:
Jumps to the first month (even thought I am using alendarFocus={"backwards"} and preventSnapRefocus={true})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants