🐛 fix(mac-window): 修复查询替换框在 macOS 无法关闭

- 放行编辑器和输入控件内的 Escape 按键事件

- 保留 macOS 原生全屏下普通区域的 Escape 抑制逻辑

- 补充 Mac 窗口快捷键回归测试

Refs #433
This commit is contained in:
Syngnat
2026-05-08 23:00:23 +08:00
parent 0c2b112234
commit faef619413
3 changed files with 21 additions and 1 deletions

View File

@@ -31,10 +31,14 @@ export const shouldSuppressMacNativeEscapeExit = (
useNativeMacWindowControls: boolean,
isFullscreen: boolean,
event: Pick<KeyboardEvent, 'key' | 'defaultPrevented'>,
options?: { isEditableTarget?: boolean },
): boolean => {
if (!isMacRuntime || !useNativeMacWindowControls || !isFullscreen) {
return false;
}
if (options?.isEditableTarget) {
return false;
}
if (event.defaultPrevented) {
return false;
}