Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

429 B
Raw Blame
export function focusTaskElement(
  taskId: string,
  moveFocus: boolean,
  rowId?: string | null,
) {
  const element = document.querySelector<HTMLElement>(
    rowId
      ? `[data-task-id="${taskId}"][data-task-row-id="${rowId}"]`
      : `[data-task-id="${taskId}"]`,
  );
  if (!element) return;
  if (moveFocus) element.focus({ preventScroll: true });
  element.scrollIntoView?.({ block: "nearest", inline: "nearest" });
}