Skip to content

Commit

Permalink
fix: timeline selector scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Feb 11, 2025
1 parent 793b19d commit 11c98c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/renderer/src/modules/timeline-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ const TimelineSelector = ({ timelineId }: { timelineId: string | undefined }) =>
if (!targetElement || isInCurrentView) {
return
}
const targetX = getNodeXInScroller(targetElement, $scroll)
const targetX = getNodeXInScroller(targetElement, $scroll) - 12

$scroll.scrollTo({
left: targetX,
behavior: "smooth",
})
}
handler()
}, [timelineId, timelineList])
}, [timelineId])
return (
<div className="mt-3 pb-4">
<div
Expand All @@ -222,11 +222,11 @@ const TimelineSelector = ({ timelineId }: { timelineId: string | undefined }) =>
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
))}

{timelineList.lists.length > 0 && <DividerVertical className="mx-2 my-auto h-8" />}
{timelineList.inboxes.length > 0 && <DividerVertical className="mx-2 my-auto h-8" />}
{timelineList.inboxes.map((timelineId) => (
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
))}
{timelineList.views.length > 0 && <DividerVertical className="mx-2 my-auto h-8" />}
{timelineList.lists.length > 0 && <DividerVertical className="mx-2 my-auto h-8" />}
{timelineList.lists.map((timelineId) => (
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
))}
Expand Down

0 comments on commit 11c98c8

Please sign in to comment.