tui.calendar
tui.calendar copied to clipboard
Incompatible with flex layout due to explicit heights
Version
1.10.0
Development Environment
Chrome 71
Current Behavior
Likely due to rounding errors in the height calculation the calendar grows by up to 4 pixels every time it is re-rendered.
When placing the calendar on a webpage with vertical flex layout re-rendering causes changes to the explicit height set to the tui-full-calendar-vlayout-area
. The function getSize
ind domutil.js
is doing the calculation.
Expected Behavior
Placing the calendar on the screen with vertical flex layout to ensure filling the screen should be possible on browsers with flex support. This could be opt-in to ensure backwards compatibility if so desired and would primarily only remove the explicit heights set and be replaced by using flex internally.
The be more specific the calendar does not need to be auto resizing based on flex (which is not easily possible) . In this case we call render and it behaves weirdly when layouted per flex when render is called.
Can also reproduce on flex layouts in FF 74 and 75.
As @matthiasg said, both growing with the flex container or just being there without mandatory growth is enough to trigger the bug, which in my case is a growth of exactly 5px with every call to render().