Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

The editor's expanded platform preview doesn't work with the keyboard

Fermée Adaptée aux débutants
#170 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
85/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
react, typescript

Piste de recherche

Lisez src/components/editor/PlatformPreviewStrip.tsx, en vous concentrant sur les cartes de plateforme, la superposition, la boîte de dialogue, le nom de la plateforme et le bouton Close. Implémentez le comportement indiqué pour le focus, Escape, le confinement de Tab, la restauration et le libellé de la boîte de dialogue, tout en conservant la fermeture par clic sur l’arrière-plan. Vérifiez le résultat à l’aide des critères d’acceptation au clavier de l’issue, puis exécutez npm run check, npm run test et npm run build.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

accessibility bug good first issue hacktoberfest ui

In the editor (for example https://og.codercops.com/create/blog), Tab to one of the platform cards under the canvas and press Enter. The expanded preview opens, but:

  • Focus stays on the card behind the overlay.
  • Escape doesn't close it. The Escape handler is on the overlay (src/components/editor/PlatformPreviewStrip.tsx, line 73), and the overlay doesn't have focus.
  • Tab keeps moving through the other seven cards underneath. After them it lands on the overlay itself, which is a role="button" (lines 69 to 72) whose name is all the text in the preview. Only there does Escape work.
  • When it closes (Escape on the overlay, or the Close button), focus drops to the page body instead of going back to the card.
  • The dialog (line 78) has no aria-modal and no accessible name, so a screen reader doesn't say which platform it shows.

What to do

  • Move focus into the dialog when it opens, for example to the Close button.
  • Close it on Escape while it's open: listen for keydown on document in a useEffect and remove the listener in the cleanup, or put the handler on the dialog.
  • Keep Tab inside the dialog while it's open (the viewport buttons and Close), so focus can't wander behind it.
  • When it closes, put focus back on the card that opened it.
  • Give the dialog aria-modal="true" and aria-labelledby pointing at the platform name (line 82). useId works for the id.
  • Remove role="button" and tabIndex from the overlay. Clicking the backdrop can still close it.

Where to look

  • src/components/editor/PlatformPreviewStrip.tsx: the cards (lines 41 to 54), the overlay (lines 68 to 74), the dialog (lines 75 to 80), the platform name (lines 82 to 84) and the Close button (lines 87 to 94)

Acceptance criteria

  • Enter on a platform card opens the preview with focus inside it
  • Escape and the Close button both close it, and focus goes back to the card
  • Tab stays inside the dialog while it's open
  • The dialog has aria-modal="true" and is labelled with the platform name
  • Mouse use works as before, including closing by clicking the backdrop
  • npm run check, npm run test and npm run build pass
  • The PR says how you tested it with the keyboard

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #170 in the description.

Langage dominant
TypeScript
Étoiles
8
Forks
4
Merge moyen
5 h 44 min
PR mergées (30 j)
83

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de codercops/ogcops

Toutes les issues de codercops/ogcops

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.