adobe/react-spectrum

onCancel should fire in AlertDialog if Escape is pressed

Open

#1,773 创建于 2021年4月7日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)TypeScript (1,500 fork)auto 404
good first issue

仓库指标

Star
 (15,634 star)
PR 合并指标
 (PR 指标待抓取)

描述

🐛 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.

贡献者指南