diff --git a/frontend/src/lib/xray/outbound-form-adapter.ts b/frontend/src/lib/xray/outbound-form-adapter.ts index 3dd5852d..bf331fca 100644 --- a/frontend/src/lib/xray/outbound-form-adapter.ts +++ b/frontend/src/lib/xray/outbound-form-adapter.ts @@ -620,7 +620,10 @@ export function formValuesToWirePayload(values: OutboundFormValues): WireOutboun } if (values.sendThrough) result.sendThrough = values.sendThrough; - if (values.mux.enabled && muxAllowed(values)) { + // mux may be absent when the modal didn't render the Mux switch (non- + // stream protocols or when isMuxAllowed gated it out). validateFields() + // only returns registered fields, so values.mux can be undefined. + if (values.mux?.enabled && muxAllowed(values)) { result.mux = values.mux; } return result; diff --git a/frontend/src/pages/xray/OutboundFormModal.tsx b/frontend/src/pages/xray/OutboundFormModal.tsx index 362efdfa..fee094f7 100644 --- a/frontend/src/pages/xray/OutboundFormModal.tsx +++ b/frontend/src/pages/xray/OutboundFormModal.tsx @@ -372,6 +372,13 @@ export default function OutboundFormModal({ if (key === '1' && activeKey === '2') { if (!applyJsonToForm()) return; } + // Blur the currently focused element before AntD marks the outgoing + // tab panel aria-hidden. Without this, a focused input inside the + // hidden panel triggers a Chrome a11y warning ("Blocked aria-hidden + // on an element because its descendant retained focus"). + if (typeof document !== 'undefined') { + (document.activeElement as HTMLElement | null)?.blur?.(); + } setActiveKey(key); }