-
Notifications
You must be signed in to change notification settings - Fork 5
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
ui-spacetimechart: fix blank stories #858
Conversation
40c8160
to
9aff6b7
Compare
The space time chart stories were sometimes not loading properly, showing a blank page. Two issues: - All stories were passing className='absolute inset-0' to SpaceTimeChart. However, SpaceTimeChart was combining these classes with 'relative'. As a result, the browser would roll a dice and pick either 'absolute' or 'relative'. When 'relative' is picked first, 'inset-0' has no effect because… - All stories except one were using a wrapper div with className="inset-0". This had no effect because this div is neither absolute nor relative. As a result, half the time the chart would have a zero height. Fix this by: - Adding absolute positioning to the wrapper div. - Setting the height of the SpaceTimeChart instead of mixing up conflicting positioning classes. Signed-off-by: Simon Ser <[email protected]>
9aff6b7
to
a612c9d
Compare
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.
Overall LGTM. This bug was extremely annoying when working on the component, so thanks a lot!
Tangent to this PR, but in the osrd repo we also use <className="inset-0 absolute h-full">, should we remove the absolute and inset-0?
More generally there seem to be a lot of conflicting positioning class uses in this component and its wrappers, which could use a cleanup.
Yes, I think so. We specify a fixed |
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.
tested, thanks!
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.
LGTM ✅
The space time chart stories were sometimes not loading properly, showing a blank page.
Two issues:
As a result, half the time the chart would have a zero height.
Fix this by: