-
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-manchette: fix waypoint menu positioning #668
Conversation
85faa8f
to
c343ac1
Compare
54d11da
to
f725c80
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.
LGTM apart from this last question!
63703d6
to
1323383
Compare
1323383
to
b0f1076
Compare
ui-manchette-with-spacetimechart/src/stories/useElementInView.ts
Outdated
Show resolved
Hide resolved
ui-manchette-with-spacetimechart/src/stories/useElementInView.ts
Outdated
Show resolved
Hide resolved
390a28e
to
99efc58
Compare
bac18b8
to
dd537cc
Compare
ad471d1
to
d3c1306
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.
the behavior is not consistent.
open the menu, then scroll down, and click and the menu shows on top of the waypoint the next time
https://github.com/user-attachments/assets/d5762a6b-62e8-4454-8fe9-455157bdc641
After discussion with @thibautsailly, it has been decided to totally block the scroll in the manchette (and only in the manchette) as long as the menu is displayed. If we still try to scroll, the whole page will scroll. (reported in the PR and issue description) |
This approach still sounds pretty fragile to me.
|
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.
We're getting close! A few new comments.
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, thanks a lot for your perseverance through this odyssey!
1b68e3e
to
4542460
Compare
- Add some type export needed when implementing the app - Remove some exports not needed outside of ui-manchette Signed-off-by: SharglutDev <[email protected]>
The PR #728 changed the height of the manchette from a min height to a fixed one. It introduced a bug where, when having a long list of waypoint, when scrolling bottom, the manchette toolbar wasn't stick to the bottom anymore. Fix this issue by giving back a min height to the manchette while still keeping its dynamic value introduced in PR #728. Signed-off-by: SharglutDev <[email protected]>
- Move the menu next to its related waypoint so it can always be positioned relatively to it - To keep osrd-ui as neutral as possible, the menu has no styles, they need to be passed by props - Add a custom hook using the intersection observer api. This will allow the menu to hide when its waypoint is hidden on scroll - This hook will remain in osrd-ui to prevent a user to have the implement this necessary logic when adding a waypoint menu to the manchette Signed-off-by: SharglutDev <[email protected]>
4542460
to
795b7bc
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.
tested again, Good job !
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.
just a bit unsure about disabling completely all the interactions outside of the menu.
it’s pretty natural to close the menu by clicking outside of it
It's just the story working like that. In osrd, you will be able to close the menu when clicking outside of it of course. |
fix #667
After discussion with @thibautsailly, it has been decided to totally block the scroll in the manchette (and only in the manchette) as long as the menu is displayed. If we still try to scroll, the whole page will scroll.