很拉风的James
6cb4bc2947
Fix: Radio.Group cloneElement crashes on non-element children ( #14407 )
...
### What problem does this PR solve?
`Radio.Group` in `web/src/components/ui/radio.tsx` injects the parent's
`disabled` prop into each child via `React.cloneElement` with
`as React.ReactElement` and no validation.
This throws at runtime when a consumer passes strings, numbers, `null`,
`false`, or other non-element nodes, while the cast hides the unsafe
access from TypeScript.
Use `React.isValidElement<RadioProps>(child)` as a type guard before
calling `cloneElement`. Non-element children pass through unchanged,
and `child.props` access becomes type-checked without an `as` cast.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
2026-05-11 09:54:42 +08:00
..
2026-03-12 21:01:09 +08:00
2026-04-09 18:51:45 +08:00
2026-01-04 19:14:20 +08:00
2025-10-13 11:10:54 +08:00
2026-03-12 21:01:09 +08:00
2026-04-14 18:07:32 +08:00
2026-04-10 19:05:14 +08:00
2026-04-14 15:24:43 +08:00
2026-05-08 13:26:13 +08:00
2026-03-25 10:47:34 +08:00
2026-03-16 15:43:13 +08:00
2026-04-30 12:36:03 +08:00
2026-04-30 23:13:27 +08:00
2026-01-04 19:14:20 +08:00
2026-03-12 13:33:36 +08:00
2026-03-05 20:47:29 +08:00
2025-12-08 11:11:48 +08:00
2026-04-28 11:39:29 +08:00
2026-04-14 16:33:52 +08:00
2025-12-08 12:21:18 +08:00
2026-03-18 21:09:32 +08:00
2026-04-30 12:36:03 +08:00
2026-03-31 18:43:24 +08:00
2026-04-21 14:06:36 +08:00
2026-05-08 14:40:00 +08:00
2026-03-11 15:06:07 +08:00
2026-05-08 14:40:00 +08:00
2026-05-09 17:40:22 +08:00
2026-05-08 14:40:00 +08:00
2026-05-08 14:40:00 +08:00
2026-04-21 14:06:36 +08:00
2026-03-11 11:27:20 +08:00
2026-04-29 14:37:48 +08:00
2026-03-02 13:03:44 +08:00
2025-12-03 14:37:58 +08:00
2026-05-11 09:54:42 +08:00
2025-10-27 10:36:36 +08:00
2026-03-04 19:28:36 +08:00
2026-04-09 18:51:45 +08:00
2025-11-27 15:55:46 +08:00
2026-03-06 21:13:14 +08:00
2026-03-12 21:01:09 +08:00
2026-04-21 16:53:08 +08:00
2025-10-27 19:37:52 +08:00
2026-03-04 19:28:36 +08:00
2026-02-27 22:26:19 +08:00
2026-03-18 21:09:32 +08:00
2026-04-21 16:53:08 +08:00
2026-04-09 16:40:14 +08:00
2026-02-27 19:17:41 +08:00
2026-03-04 19:28:36 +08:00
2026-03-04 19:28:36 +08:00
2025-12-03 14:37:58 +08:00
2026-04-21 15:24:13 +08:00
2026-01-04 19:14:20 +08:00
2026-03-16 20:15:49 +08:00
2026-01-04 19:14:20 +08:00
2026-05-08 14:40:00 +08:00
2026-04-29 17:03:33 +08:00
2026-03-05 20:47:29 +08:00
2026-03-13 16:31:17 +08:00
2026-04-30 12:36:03 +08:00
2025-11-19 16:16:57 +08:00
2026-04-29 14:37:48 +08:00
2026-03-05 18:51:57 +08:00
2026-04-25 00:33:02 +08:00
2025-11-27 15:55:46 +08:00
2026-04-20 19:24:20 +08:00
2025-12-23 11:54:32 +08:00
2026-01-22 19:45:25 +08:00
2025-12-17 12:58:48 +08:00
2026-03-06 21:13:14 +08:00
2026-03-24 19:24:41 +08:00
2026-01-27 09:49:46 +08:00
2025-08-13 15:59:51 +08:00
2026-03-04 19:28:36 +08:00
2025-12-08 11:11:48 +08:00
2026-03-06 21:13:14 +08:00
2026-04-15 19:05:54 +08:00
2026-03-05 18:13:19 +08:00
2026-03-27 09:31:08 +08:00
2025-10-27 15:15:12 +08:00
2026-04-21 14:06:36 +08:00
2025-11-10 10:05:19 +08:00
2026-03-06 21:13:14 +08:00
2025-08-26 17:57:53 +08:00
2025-08-13 15:59:51 +08:00
2025-12-01 09:49:28 +08:00
2026-04-21 16:53:08 +08:00
2025-10-10 18:35:43 +08:00
2025-12-03 14:37:58 +08:00
2025-12-03 14:37:58 +08:00
2025-12-22 14:37:39 +08:00
2026-03-05 20:47:29 +08:00