adobe/react-spectrum

onCancel should fire in AlertDialog if Escape is pressed

Open

#1.773 geöffnet am 7. Apr. 2021

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (1.500 Forks)auto 404
good first issue

Repository-Metriken

Stars
 (15.634 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

🐛 Bug Report (or maybe feature request?)

When adding an onCancel handler to an AlertDialog, it should fire if the dialog is closed via the Escape key.

See here for a repro: https://codesandbox.io/s/adoring-meadow-7cl4c?file=/src/App.js

Open the dialog, click Cancel, dialog will close, you'll see 'Canceled' in the console. Open the dialog, press Escape key, dialog will close, no 'Canceled' in the console.

Contributor Guide