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

Strange behavior when clicking days with outside modifier #97

Closed
jkillian opened this issue Nov 20, 2015 · 5 comments
Closed

Strange behavior when clicking days with outside modifier #97

jkillian opened this issue Nov 20, 2015 · 5 comments

Comments

@jkillian
Copy link
Contributor

The first bug is that clicking outside days only changes the month if you have an onDayClick prop set (which is surprising behavior). This seems to be because handleDayClick is only called if props.onDayClick is set. I think this should maybe be opt-in behavior that happens regardless of onDayClick's value?

The second bug is that you can use this month changing functionality to navigate to days outside of the bounds set by fromMonth and toMonth. It seems that showMonthForOutsideDays doesn't check if the month is allowed or not. Perhaps instead of calling setState directly it should call showMonth instead?

@jkillian jkillian changed the title Strange behavior when clicking outside day Strange behavior when clicking days with outside modifier Nov 20, 2015
@gpbl
Copy link
Owner

gpbl commented Nov 21, 2015

  1. yes, this was a design choice
  2. this is indeed a bug 💧 i agree it should call showMonth and not directly set the state

@gpbl gpbl added the bug label Nov 21, 2015
@gpbl gpbl closed this as completed in d7aff64 Nov 24, 2015
gpbl added a commit that referenced this issue Nov 24, 2015
Do not show months for outside days (fix #97)
@jkillian
Copy link
Contributor Author

jkillian commented Dec 3, 2015

Thanks for the fix for the second bug! However, I think we might have messed up a little bit - instead of using showMonth, I think it should use showPreviousMonth and showNextMonth. This way, the onMonthChange prop will get called as it should be.

@gpbl
Copy link
Owner

gpbl commented Dec 3, 2015

@jkillian Our reasoning was right, because the old code is actually displaying a month based on the numberOfMonths prop, so not always is the next/prev month. However, this is actually an old behavior which should have already been changed. Going to fix this as well 👍

@gpbl gpbl reopened this Dec 3, 2015
@gpbl
Copy link
Owner

gpbl commented Dec 3, 2015

See #112

@gpbl
Copy link
Owner

gpbl commented Dec 4, 2015

@jkillian these issues should be fixed in the new 1.2.0 release. There's event a new example showing the corrected behaviors.

@gpbl gpbl closed this as completed Dec 4, 2015
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

No branches or pull requests

2 participants