Sync cursor highlight to hovered answer button on mouseover

This commit is contained in:
justin committed 2026-05-20 11:43:00 -07:00
1 parent 1498bc261c
commit b78557dbf2
1 file changed
+9
+9
View File
@@ -1147,10 +1147,19 @@ class Game {
} else { } else {
btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, q, container)); btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, q, container));
} }
btn.addEventListener('mouseenter', () => {
this.state.cursor = slotIdx;
this._renderCursor();
});
container.appendChild(btn); container.appendChild(btn);
}); });
if (isMulti) { if (isMulti) {
confirmBtn.addEventListener('mouseenter', () => {
if (confirmBtn.classList.contains('confirm-inactive')) return;
this.state.cursor = 4;
this._renderCursor();
});
container.appendChild(confirmBtn); container.appendChild(confirmBtn);
container._confirmBtn = confirmBtn; container._confirmBtn = confirmBtn;
} }