diff --git a/scm-ui/ui-components/src/repos/diff/DiffFileTree.tsx b/scm-ui/ui-components/src/repos/diff/DiffFileTree.tsx index 58d18fce1f..0864a500f5 100644 --- a/scm-ui/ui-components/src/repos/diff/DiffFileTree.tsx +++ b/scm-ui/ui-components/src/repos/diff/DiffFileTree.tsx @@ -102,7 +102,7 @@ const TreeNode: FC = ({ 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; `; diff --git a/scm-ui/ui-components/src/useScrollToElement.ts b/scm-ui/ui-components/src/useScrollToElement.ts index 125f9c2990..0e00b679e2 100644 --- a/scm-ui/ui-components/src/useScrollToElement.ts +++ b/scm-ui/ui-components/src/useScrollToElement.ts @@ -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);