From 204748699eb3ef8847a85ebd8c8acbacdae5d9cd Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 23 Nov 2025 12:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=A4=96=E9=83=A8=E7=82=B9=E5=87=BB=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/dialog/MyProfileDialog.tsx | 2 ++ client/ui/preference/TextFieldPreference.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/ui/dialog/MyProfileDialog.tsx b/client/ui/dialog/MyProfileDialog.tsx index e240e06..e2708e5 100644 --- a/client/ui/dialog/MyProfileDialog.tsx +++ b/client/ui/dialog/MyProfileDialog.tsx @@ -106,6 +106,8 @@ export default function MyProfileDialog({ }, } ], + closeOnEsc: true, + closeOnOverlayClick: true, })}>退出登录 diff --git a/client/ui/preference/TextFieldPreference.tsx b/client/ui/preference/TextFieldPreference.tsx index 424be9b..ac8e61f 100644 --- a/client/ui/preference/TextFieldPreference.tsx +++ b/client/ui/preference/TextFieldPreference.tsx @@ -13,7 +13,7 @@ interface Args extends React.HTMLAttributes { export default function TextFieldPreference({ title, icon, description, id, state, disabled }: Args) { const updater = React.useContext(PreferenceUpdater) - + return { prompt({ headline: title, @@ -22,11 +22,13 @@ export default function TextFieldPreference({ title, icon, description, id, stat onConfirm: (value) => { updater(id, value) }, - onCancel: () => {}, + onCancel: () => { }, textFieldOptions: { label: description, value: state, }, + closeOnEsc: true, + closeOnOverlayClick: true, }) }}> {title}