@1771technologies/lytenyte-pro
Version:
Blazingly fast headless React data grid with 100s of features.
14 lines (13 loc) • 429 B
JavaScript
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
import { getPanel } from "../utils/get-panel.js";
// Assumes that el is a branch or leaf node
export function getNextNode(el) {
const panel = getPanel(el);
if (!panel)
return;
const focusables = getFocusableNodes(panel);
const index = focusables.indexOf(el);
if (index === -1)
return;
return focusables.at(index + 1);
}