MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / setSelectedRow

Function setSelectedRow

codeclash/viewer/static/js/picker.js:656–682  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

654}
655
656function setSelectedRow(index) {
657 // Remove previous selection
658 if (
659 currentSelectedIndex >= 0 &&
660 currentSelectedIndex < allNavigableRows.length
661 ) {
662 allNavigableRows[currentSelectedIndex].classList.remove(
663 "keyboard-selected",
664 );
665 }
666
667 // Set new selection
668 currentSelectedIndex = index;
669 if (
670 currentSelectedIndex >= 0 &&
671 currentSelectedIndex < allNavigableRows.length
672 ) {
673 const selectedRow = allNavigableRows[currentSelectedIndex];
674 selectedRow.classList.add("keyboard-selected");
675
676 // Scroll into view if needed
677 selectedRow.scrollIntoView({
678 behavior: "smooth",
679 block: "nearest",
680 });
681 }
682}
683
684function handleKeyboardNavigation(event) {
685 // Don't handle keyboard navigation if a dialog is open or input is focused

Callers 3

navigateUpFunction · 0.85
navigateDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected