fix(editors): focus the dialog without selecting its name field

Cancel the non-bubbling FocusScope mount event in the capture phase and focus the dialog itself. Keep keyboard navigation working without highlighting the name or opening the touch keyboard automatically.
This commit is contained in:
翅膀 committed 2026-10-17 13:23:17 +08:00
1 parent 2035f9f476
commit 462f1db833
5 files changed
+35 -2

No files matched your search

+1
View File
@@ -260,6 +260,7 @@ function close(): void {
// A click on the backdrop must not discard what has been typed so far.
const { isBackdropClose } = useBackdropGuard(() => props.open, ".editor-dialog");
useDialogFocus(() => props.open, ".editor-dialog");
function onOpenChange(open: boolean): void {
if (!open && !isBackdropClose()) close();