MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / selectNextElement

Function selectNextElement

app.js:5036–5046  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5034
5035// Utility function to cycle through elements with Tab key
5036function selectNextElement() {
5037 if (elements.length === 0) return;
5038
5039 let currentIndex = -1;
5040 if (selectedId) {
5041 currentIndex = elements.findIndex(el => el.id === selectedId);
5042 }
5043
5044 const nextIndex = (currentIndex + 1) % elements.length;
5045 selectElement(elements[nextIndex].id, false);
5046}
5047
5048function selectPreviousElement() {
5049 if (elements.length === 0) return;

Callers 1

app.jsFile · 0.85

Calls 1

selectElementFunction · 0.85

Tested by

no test coverage detected