Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

It should not be an error for focus to point to a missing `NodeId`

Aperta
#587 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
accessibility

Direzione di ricerca

Inizia tracciando la gestione esistente di AccessKit del NodeId radice e del NodeId con il focus, in particolare il controllo dei nodi sconosciuti e il percorso Action::ScrollIntoView. Confronta le alternative proposte per il fallback, il supporto ai nodi sconosciuti e i nodi orfani prima di scegliere un comportamento. Il lavoro è completato quando l’assenza della destinazione del focus non causa più un errore erroneo e il comportamento selezionato è coperto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kas::Id is a (compressed) path, which allows tracking focus of unrealised (hidden) entries in a list while virtual scrolling. As such, it is not a bug for Kas's focus to point at a widget which doesn't exist. It is still possible to operate on such an Id by scrolling it back into view.

(No, Kas does not do this by keeping a copy of any widget in focus while scrolled out of view. It would be possible, but would require hacks in widget code, and imply that bugs in widget code can crash a UI when accessibility is enabled.)

Working around this

From the Kas side, I can check whether nav_focus points to a reachable widget (reverting to the root Id if not), but this is not equivalent to the AccessKit check since Kas may have dormant nodes not in the AccessKit tree. To accurately match the AccessKit check I'd need to store a copy of the tree.

The right way?

AccessKit already knows the root NodeId and tests focus; it would be much easier to revert to the root id in AccessKit.

Alternatively, AccessKit might actually try to support operations on unknown nodes. It could at least attempt Action::ScrollIntoView.

Or AccessKit could even keep the Node in its own tree as an orphan in this case. It is likely not wrong given that no more up-to-date representation of the Node is available. (Yes, I'm hesitant to suggest this. But, at least for Kas, it is more correct behaviour than panicking because focus does not point at a known Node.)

Lingua principale
Rust
Stelle
1.5k
Fork
115
Merge medio
1g 8h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AccessKit/accesskit

Tutte le issue di AccessKit/accesskit

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.