fix overlapping sidebar with tabs in techdocs (#6121)

Signed-off-by: Yousif Al-Raheem <yousifalraheem@gmail.com>
This commit is contained in:
Yousif Al-Raheem
2021-06-21 12:40:48 +02:00
committed by GitHub
parent d1d81a3659
commit aefd54da6e
2 changed files with 9 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---
Fix the overlapping between the sidebar and the tabs navigation when enabled in mkdocs (features: navigation.tabs)
@@ -64,9 +64,10 @@ export const Reader = ({ entityId, onReady }: Props) => {
const updateSidebarPosition = useCallback(() => {
if (!!shadowDomRef.current && !!sidebars) {
const mdTabs = shadowDomRef.current!.querySelector(
'.md-container > .md-tabs',
);
const shadowDiv: HTMLElement = shadowDomRef.current!;
const shadowRoot =
shadowDiv.shadowRoot || shadowDiv.attachShadow({ mode: 'open' });
const mdTabs = shadowRoot.querySelector('.md-container > .md-tabs');
sidebars!.forEach(sidebar => {
const newTop = Math.max(
shadowDomRef.current!.getBoundingClientRect().top,