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
Scroll calendar to current week on first load #276
Scroll calendar to current week on first load #276
Conversation
Thanks. Sounds like a good approach. @zach2825 is doing a good deal of front-end these days, so perhaps he can give this one a review too as my JS was never that great and I'm rusty to boot. |
Ah ok, my bad. I'll tag Zach next time then instead for these frontend ones. |
@JSn1nj4 I am not sure what is happening here - I pulled the branch down but not sure what the effect should be |
@bogdankharchenko it's just making the calendar view move down to the current week on initial render instead of sticking to the top of the month. This does depend on the height of the calendar view and viewport though. The more of the month that shows vertically, or the closer to the top of the month the current week is, the less scroll there may be. I'm going to check if there's an easy way to add a light scroll animation in a minute. |
Thanks @zach2825 for the suggestion
Thanks @zach2825 for the smooth scroll suggestion. Didn't realize @bogdankharchenko how does this look? |
Functionally, looks good but wasn't the one making this request. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎆 Looks really good!
The basic requirements are listed here
Attempting to move to the current week happens from Full Calendar's
loading
hook, which seems to fire both when loading and after loading is completed.It will only happen on first render using a local var. This is because this hook is fired on first load and every time someone navigates using the calendar's "Next"/"Previous" buttons.
Re-centering also doesn't happen if someone manually navigates back to the current month instead of reloading the page.
Resolves #253