mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-19 05:52:11 +01:00
Fix invalid HTML for file tree and escale query selectors
This commit is contained in:
@@ -102,7 +102,7 @@ const TreeNode: FC<NodeProps> = ({ node, parentPath, currentFile, setCurrentFile
|
||||
|
||||
type FileProps = { path: string; parentPath: string; currentFile: string; setCurrentFile: (path: string) => void };
|
||||
|
||||
export const TreeFileContent = styled.li`
|
||||
export const TreeFileContent = styled.div`
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
|
||||
@@ -39,13 +39,13 @@ const useScrollToElement = (
|
||||
clearInterval(intervalId);
|
||||
} else {
|
||||
tries++;
|
||||
const element = contentRef.querySelector(elementSelector);
|
||||
const element = contentRef.querySelector(CSS.escape(elementSelector));
|
||||
if (element) {
|
||||
const headerElement = document.querySelector(".navbar-brand");
|
||||
const margin = headerElement ? headerElement.getBoundingClientRect().height : 45;
|
||||
clearInterval(intervalId);
|
||||
const y = element.getBoundingClientRect().top + window.pageYOffset - margin;
|
||||
window.scrollTo({top: y});
|
||||
window.scrollTo({ top: y });
|
||||
}
|
||||
}
|
||||
}, 200);
|
||||
|
||||
Reference in New Issue
Block a user