Issue of the problem found on app-degree-pages, which uses components-core anchor menu.
The anchor menu hard codes the container-xl
Solution
The component will look at the content of the first item and align with those containers found or will default to container-xl
Also added some performance to avoid re-rendering:
optimized functions with multi state updates to only update state once
moved sticky to state, bad practice to use a ref when we can use a state
added throttle and debounce functions to limit scroll events
Alternate solution would be to add a prop for container
Description
Issue of the problem found on app-degree-pages, which uses components-core anchor menu. The anchor menu hard codes the container-xl
Solution
The component will look at the content of the first item and align with those containers found or will default to container-xl Also added some performance to avoid re-rendering:
Alternate solution would be to add a prop for container
Links
Checklist
yarn install
&yarn build
Browsers
Images