-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Bug] No switching from day view to week view on resize #231
Comments
I guess it's because of design considerations, since the week mode won't look good on smaller screens |
That has nothing to do with small screens/resolutions, the issue exists on regular screens. |
@lukasz-fi Sorry I misunderstood you |
The issue seems to be that while the check for "is small screen" does work and is ran on window resize The "easiest" fix would be to switch from A better approach would be to keep track of whether the user changed their mode manually. If the user did not manually change the mode we should be "safe" to change the if (this.isSmall && !['day', 'month'].includes(this.mode)) {
this.mode = 'day';
} to something like if (this.isSmall) {
if (!['day', 'month'].includes(this.mode)) {
this.mode = 'day';
}
} else {
if (!['week', 'month'].includes(this.mode)) {
this.mode = 'week';
}
} @tomosterlund I'd be willing to attempt to submit a PR with a fix for this if you would point me in the right direction (or validate that either of my approaches would work). |
Hi. Since week is the default view this would make sense. I'd be open to have a look at a PR with this change. My guess is you've actually coded the full solution here in your last comment already. Additionally, but optionally I'd say, you could write a unit test for this in |
Context (REQUIRED):
Describe the bug (REQUIRED)
On web browser resize the calendar doesn't switch back to
week
mode after it once has switched today
mode.To Reproduce
Steps to reproduce the behavior:
week
mode (perdefaultMode
)day
view mode.Expected behavior
After the resize the calendar should switch back to
week
mode.The text was updated successfully, but these errors were encountered: