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

Unwanted Focus Shift to First Tabstop on Checkbox Click

Aperta
#10,452 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

Start in modules/alloy/src/main/ts/ephox/alloy/keying/TabbingTypes.ts, especially focusIn and the related findInitial call. Reproduce the behavior with the linked fiddle and compare it with related issue #5721. Done means clicking an interactive checkbox keeps focus on it and checks it, while the first tabstop is used only when no element is focused.

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

Descrizione

component: ui type: bug

Component: Tabbing/keyboard navigation system (KeyingType with TabbingConfig)

Behavior: When clicking a checkbox at end of long panel with scroll, the focus first jumps to the first [data-alloy-tabstop="true"] (usualy text input) element before focusing the clicked element. And checkbox not checked.

Expected: Focus should remain on the clicked element if it’s interactive (e.g., checkbox). The first tabstop should only receive focus if no element is already focused.

Example: https://fiddle.tiny.cloud/LG7cNN2tsK/0

Root Cause:
The focusIn function forces focus on the first tabstop during initialization or focus events, overriding browser-native focus behavior.

Code Location: https://github.com/tinymce/tinymce/blob/18588f721befc89edbbdaa028c0d2545791690c9/modules/alloy/src/main/ts/ephox/alloy/keying/TabbingTypes.ts#L52-L57

Possible fix (I haven't checked if it works, otherwise I would have sent a PR right away):

const focusIn = (component: AlloyComponent, tabbingConfig: TabbingConfig, _tabbingState: Stateless): void => {
  // If there is already active focus inside the component, we do nothing.
  const hasActiveFocus = component.element.dom.contains(document.activeElement);
  
  if (!hasActiveFocus) {
    findInitial(component, tabbingConfig).each((target) => {
      tabbingConfig.focusManager.set(component, target);
    });
  }
};

related to: #5721

Lingua principale
TypeScript
Stelle
16.3k
Fork
2.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 tinymce/tinymce

Tutte le issue di tinymce/tinymce

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.