Escape doesn't dismiss a ModalOverlay in WebKit while its CSS keyframe enter animation is running (react-aria 3.53 / RAC 1.22)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
Start by reproducing the Escape-during-enter-animation case in Playwright WebKit using a ModalOverlay with a CSS keyframe animation while isEntering is true. Then trace how useEnterAnimation, useModalOverlay and useDialog gate keyboard dismissal on isEntering, using the 3.51.0 to 3.53.0 change (PR #10102) as the reference point. Done means Escape closes the modal during the enter animation in WebKit and the Chromium and Firefox behaviour is unchanged.
由索引模型根据 Issue 内容生成。
描述
Provide a general summary of the issue here
In WebKit, pressing Escape while a ModalOverlay is still playing a CSS keyframe enter animation does nothing, and the modal stays open. It works in Chromium and Firefox, and it worked in react-aria 3.51.0 / RAC 1.20.0. Using a CSS transition for the same fade instead of a keyframe animation avoids the problem.
🤔 Expected Behavior?
Escape dismisses the modal whenever it's open, including during its enter animation, as it did in 3.51.0 and still does in Chromium/Firefox.
😯 Current Behavior
The keypress is ignored until the enter animation has finished. Pressing Escape again afterwards closes the modal.
A minimal setup that reproduces it (Tailwind + tailwindcss-animate):
Open
<ModalOverlay
isDismissable
className={({ isEntering }) => isEntering ? 'animate-in fade-in duration-200' : ''}
<Modal>
<Dialog><input autoFocus /></Dialog>
</Modal>
Playwright (WebKit): focus the trigger, press Enter, then press Escape right away. The dialog is still visible after 5 s.
StackBlitz Reproduction
It's hard to reproduce this in Stackblitz
🖥️ Steps to Reproduce
- Render the snippet above, with a CSS keyframe enter animation (e.g.
animate-in fade-in duration-200) onModalOverlaywhileisEntering. - Open the page in Safari / Playwright WebKit.
- Focus the "Open" button and press Enter.
- Immediately press Escape, before the 200 ms fade-in has finished.
- The modal stays open. Pressing Escape again after the animation has finished closes it.
💁 Possible Solution
Keyboard dismissal (and the other useOverlay behaviour) should stay active while isEntering is true. Alternatively, the enter-animation tracking shouldn't block it when the running animation is a CSS keyframe animation on the overlay.
🔦 Context
Our Playwright WebKit integration tests started failing consistently after upgrading react-aria 3.51.0 → 3.53.1 and react-aria-components 1.20.0 → 1.22.1. It also affects real Safari users: Escape right after opening a modal (e.g. a ⌘K command menu) is ignored.
We worked around it by switching the overlay's fade from a CSS keyframe animation to a CSS transition, but keyframe enter animations on ModalOverlay are a common pattern (including in the RAC Tailwind examples), so others are likely to hit this.
PR #10102 (3.53.0) reworked useEnterAnimation and added isEntering handling to useModalOverlay/useDialog. That looks like the likely source; #10782 was another regression from the same change.
Version
[email protected]
[email protected]
[email protected]
What browsers are you seeing the problem on?
Safari
If other, please specify.
WebKit, Playwright WebKit 27.2
What operating system are you using?
macOS, and Linux
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
- 主要语言
- TypeScript
- 星标
- 16k
- 派生
- 1.6k
- 平均合并
- 4 天 10 小时
- 30 天内合并 PR
- 42
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adobe/react-spectrum 的其他 Issue
-
Declare @types/react as an optional peer dependency可能已有人在做 @Sophran-fbj 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10940 ·
维护者通常 1 天内回复
-
@internationalized/number: NumberParser misparses Arabic-digit numbers that use . , or ، (sd parses ١٬٢٣٤.٥ as 12345)可能已有人在做 @itsrayeedscodespace 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
adobe/react-spectrum#10936 · 3 条评论 ·
维护者通常 1 天内回复
-
PreviewTrigger: the preview dialog has no accessible name可能已有人在做 @therealemmanueloppong 于 6 天前认领。 未关闭accessibility bug PreviewTrigger
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10917 · 3 条评论 ·
维护者通常 1 天内回复
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit可能重新可做 @darshpatel1052 于 9 天前认领,目前没有进行中的 PR。 未关闭waiting on author
难度 2/5 1 小时以内 新手友好度 88/100
adobe/react-spectrum#10909 · 3 条评论 ·
维护者通常 1 天内回复
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValue可能已有人在做 @mrlexcoder 于 9 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
adobe/react-spectrum#10900 · 2 条评论 ·
维护者通常 1 天内回复
查看 adobe/react-spectrum 的全部 Issue
相似的 Issue
-
maintenance
难度 2/5 1-3 小时 新手友好度 73/100
assistant-ui/assistant-ui#10499 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug server-sequentialthinking v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5526 · 1 条评论 ·
维护者通常 1 天内回复
-
app-server bug CLI
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
better-auth/better-auth#12458 · 1 个 reaction ·
维护者通常 1 天内回复