Merge pull request #6355 from adrianke77/techdocs-sidebars-not-adjusting-position

TechDocs: Sidebars not adjusting positions
This commit is contained in:
Eric Peterson
2021-07-14 17:43:31 +02:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
@@ -82,10 +82,10 @@ export const Reader = ({ entityId, onReady }: Props) => {
useEffect(() => {
updateSidebarPosition();
window.addEventListener('scroll', updateSidebarPosition);
window.addEventListener('scroll', updateSidebarPosition, true);
window.addEventListener('resize', updateSidebarPosition);
return () => {
window.removeEventListener('scroll', updateSidebarPosition);
window.removeEventListener('scroll', updateSidebarPosition, true);
window.removeEventListener('resize', updateSidebarPosition);
};
// an update to "state" might lead to an updated UI so we include it as a trigger