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

Calendar repositions it's months after first render #7

Open
Suntechnick opened this issue Apr 17, 2020 · 4 comments
Open

Calendar repositions it's months after first render #7

Suntechnick opened this issue Apr 17, 2020 · 4 comments

Comments

@Suntechnick
Copy link

Suntechnick commented Apr 17, 2020

Using the official example from codepen: https://codepen.io/Paul-DS/pen/wOpyNq

After the initial render for a few moments calendar is displayed like this:
Screenshot 2020-04-17 at 10 42 22

And then it rerenders to desired result:
Screenshot 2020-04-17 at 10 42 35

Is there any way to avoid this transition?

@nistadev
Copy link

Same happens to me. Any solutions?

@Suntechnick
Copy link
Author

I changed CSS month positioning to use display: flex and this problem is gone for now. It could break something else however.

@nistadev
Copy link

@Suntechnick which CSS selector for the month you used? can you share the code?

@Suntechnick
Copy link
Author

.calendar .months-container { display: flex !important; flex-flow: row wrap !important; justify-content: center !important; } .calendar .months-container .month-container { height: auto !important; padding: 0 !important; } .calendar .months-container .month-container { flex: 1 1 0 !important; } .calendar .months-container .month-container.month-2 { width: auto !important; } .calendar .months-container .month-container.month-3 { width: auto !important; } .calendar .months-container .month-container.month-4 { width: auto !important; } .calendar .months-container .month-container.month-6 { width: auto !important; } .calendar .months-container .month-container.month-12 { width: auto !important; }

Something like that should do it. Include these on top of the library styles.
Be aware that this changes default positioning behaviour so I can't really recommend this solution.

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