mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): fix file tree click not scrolling to file section (#22924)
This commit is contained in:
@@ -66,6 +66,10 @@ export const TemplateFiles: FC<TemplateFilesProps> = ({
|
||||
fileTree={fileTree}
|
||||
onSelect={(path: string) => {
|
||||
window.location.hash = path;
|
||||
document.getElementById(path)?.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "start",
|
||||
});
|
||||
}}
|
||||
Label={({ path, filename, isFolder }) => {
|
||||
if (isFolder) {
|
||||
|
||||
Reference in New Issue
Block a user