Routing Callback
- Dominant language
- JavaScript
- Stars
- 83
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
In order to make the documentation menu animate correctly, I think I need to know when a new route is being navigated to. Is there a way to trigger an event in this case that can be responded to by the other nav items?
Here's what happens:
- when a section is expanded, the height of the child section is calculated so that it can be animated to (CSS won't animate to 'auto' height).
- when the animation is finished, I will set it back to 'auto' in order to accommodate changes inside it which change its height.
- when _another_ menu item is navigated to, that may cause the current section to collapse, which means the height needs to be set back to a number, instead of `auto` but I don't know how to hook up an event in that scenario.
Contributor guide
Research direction
Start by tracing the documentation menu's route-navigation and section animation logic in the website code; the issue does not name a file or test. Determine whether an existing navigation callback or event can notify other menu items, and consider the work done when navigating to another item lets the current section reset its height and collapse correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100