This commit is contained in:
Rizky 2024-07-27 18:10:50 +07:00
parent f0af063c9c
commit 86808327ae
4 changed files with 15 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@ const target = {
export const active = {
should_render_main: true,
hover: { id: "" },
hover: { id: "", tree: false },
scope: {} as any,
script_nav: {
list: [] as {

View File

@ -35,7 +35,18 @@ export const EdTreeBody = () => {
if (tree.length === 0)
return (
<div className="flex py-[100px] select-none justify-center flex-1">
<div
className="flex py-[100px] select-none justify-center flex-1"
onPointerMove={() => {
active.hover.tree = true;
}}
onPointerOut={() => {
active.hover.tree = false;
}}
onPointerLeave={() => {
active.hover.tree = false;
}}
>
<div className="flex flex-col items-center">
<img
draggable={false}

View File

@ -8,7 +8,7 @@ export const scrollTreeActiveItem = () => {
`.tree-${active.item_id}`
) as HTMLDivElement;
if (div) {
div.scrollIntoView();
if (!active.hover.tree) div.scrollIntoView();
}
if (i > 7) clearInterval(ival);
i++;