fix(palette): corriger les options de la palette de recherche inutilisables au clic (le re-rendu au survol detruisait l'element sous le curseur)
FlowDeck CI / lint (push) Successful in 48s
FlowDeck CI / test (push) Successful in 5m10s
FlowDeck CI / docker (push) Successful in 44s

This commit is contained in:
2026-09-13 20:31:30 -04:00
parent 3b3e95e23a
commit 055956a351
+14 -1
View File
@@ -2130,7 +2130,20 @@
input.blur();
}
function toggle(){ state.open ? close() : open(); }
function setIndex(i){ if(i>=0 && i<state.items.length){ state.index=i; render(); } }
function setIndex(i){
if(i>=0 && i<state.items.length) state.index=i;
// Toggle the active class without rebuilding #fd-cp-list: re-rendering on
// hover destroys the element under the cursor and breaks the next click.
var nodes = list.querySelectorAll('.cmd-palette-item');
for(var j=0;j<nodes.length;j++){
if(parseInt(nodes[j].getAttribute('data-idx'),10)===state.index){
nodes[j].classList.add('active');
nodes[j].scrollIntoView({block:'nearest'});
} else {
nodes[j].classList.remove('active');
}
}
}
function choose(i){
var it = state.items[i]; if(!it) return;
if(it.run){ var ok = it.run(); if(ok) close(); return; }