mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
AntD Tabs with the `items` API lazy-mounts inactive tab panes by
default. The Form.Items inside an unvisited tab never register, so:
- Form.useWatch on a parent path (e.g. 'sniffing') returns a partial
view containing only registered children. Until the user clicked the
Sniffing tab, Advanced > Sniffing JSON showed `{sniffing: {}}`
instead of the full default object set by setFieldsValue.
- After visiting the Sniffing tab once, the `sniffing.enabled` Form.Item
registered, so useWatch suddenly returned `{enabled: false}` — still
partial, because the rest of the sniffing children only register when
their Form.Items mount in conditional sub-sections.
Setting `forceRender: true` on every tab item forces all tab panes to
mount at modal open. Every Form.Item registers immediately; the watch
result reflects the full form value seeded by buildAddModeValues. This
also likely resolves the earlier "Invalid discriminator value" error
on submit, which surfaced when streamSettings had an unregistered
security field whose Form.Item hadn't mounted yet.
|
||
|---|---|---|
| .. | ||
| api | ||
| components | ||
| entries | ||
| generated | ||
| hooks | ||
| i18n | ||
| layouts | ||
| lib/xray | ||
| models | ||
| pages | ||
| schemas | ||
| styles | ||
| test | ||
| utils | ||
| env.d.ts | ||
| main.tsx | ||
| queryClient.ts | ||
| routes.tsx | ||