本文整理汇总了TypeScript中@library/dom/TabHandler.getNext函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getNext函数的具体用法?TypeScript getNext怎么用?TypeScript getNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getNext函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("can handle all options at once", () => {
document.body.innerHTML = `
<div>
<button id="initialFocus"></button>
<button id="beforeRoot"></button>
<div id="treeRoot">
<div id="tree1">
<button id="item1"></button>
<button id="item2"></button>
</div>
<div id="tree2">
<button id="itemExcluded"></button>
<button id="item3"></button>
</div>
<div id="tree3">
<button id="item4"></button>
<button id="item5"></button>
</div>
</div>
</div>`;
const tree1 = document.getElementById("tree1")!;
const tree2 = document.getElementById("tree2")!;
const item3 = document.getElementById("item3")!;
const item5 = document.getElementById("item5")!;
const treeRoot = document.getElementById("treeRoot")!;
const itemExcluded = document.getElementById("itemExcluded")!;
const initialFocus = document.getElementById("initialFocus")!;
initialFocus.focus();
const handler = new TabHandler(treeRoot, [itemExcluded], [tree1]);
const nextItem = handler.getNext(item3, true);
expect(nextItem).eq(item5);
});