mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
fix(monaco): disable MUI Dialog focus enforcement for Monaco editor #5885
Closes #5885
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
### 🐞 修复问题
|
||||
|
||||
- 修复 macOS 有线网络 DNS 劫持失败
|
||||
- 修复 Monaco 编辑器内右键菜单显示异常
|
||||
|
||||
<details>
|
||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
||||
|
||||
@@ -15,6 +15,7 @@ interface Props {
|
||||
open: boolean;
|
||||
okBtn?: ReactNode;
|
||||
cancelBtn?: ReactNode;
|
||||
disableEnforceFocus?: boolean;
|
||||
disableOk?: boolean;
|
||||
disableCancel?: boolean;
|
||||
disableFooter?: boolean;
|
||||
@@ -37,6 +38,7 @@ export const BaseDialog: React.FC<Props> = ({
|
||||
children,
|
||||
okBtn,
|
||||
cancelBtn,
|
||||
disableEnforceFocus,
|
||||
contentSx,
|
||||
disableCancel,
|
||||
disableOk,
|
||||
@@ -47,7 +49,11 @@ export const BaseDialog: React.FC<Props> = ({
|
||||
onClose,
|
||||
}) => {
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose}>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
disableEnforceFocus={disableEnforceFocus}
|
||||
>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
|
||||
<DialogContent sx={contentSx}>{children}</DialogContent>
|
||||
|
||||
@@ -382,7 +382,13 @@ export const EditorViewer = <T extends Language>(props: Props<T>) => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} maxWidth="xl" fullWidth>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
maxWidth="xl"
|
||||
fullWidth
|
||||
disableEnforceFocus
|
||||
>
|
||||
<DialogTitle>{resolvedTitle}</DialogTitle>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -427,7 +427,13 @@ export const GroupsEditorViewer = (props: Props) => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} maxWidth="xl" fullWidth>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
maxWidth="xl"
|
||||
fullWidth
|
||||
disableEnforceFocus={!visualization}
|
||||
>
|
||||
<DialogTitle>
|
||||
{
|
||||
<Box display="flex" justifyContent="space-between">
|
||||
|
||||
@@ -272,7 +272,13 @@ export const ProxiesEditorViewer = (props: Props) => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} maxWidth="xl" fullWidth>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
maxWidth="xl"
|
||||
fullWidth
|
||||
disableEnforceFocus={!visualization}
|
||||
>
|
||||
<DialogTitle>
|
||||
{
|
||||
<Box display="flex" justifyContent="space-between">
|
||||
|
||||
@@ -506,7 +506,13 @@ export const RulesEditorViewer = (props: Props) => {
|
||||
});
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} maxWidth="xl" fullWidth>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
maxWidth="xl"
|
||||
fullWidth
|
||||
disableEnforceFocus={!visualization}
|
||||
>
|
||||
<DialogTitle>
|
||||
{
|
||||
<Box display="flex" justifyContent="space-between">
|
||||
|
||||
@@ -612,6 +612,7 @@ export function DnsViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
return (
|
||||
<BaseDialog
|
||||
open={open}
|
||||
disableEnforceFocus={!visualization}
|
||||
title={
|
||||
<Box display="flex" justifyContent="space-between" alignItems="center">
|
||||
{t("settings.modals.dns.dialog.title")}
|
||||
|
||||
Reference in New Issue
Block a user