mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
fix(routes): prevent synthetic event recycling issue in name input handler
This commit is contained in:
@@ -408,7 +408,13 @@ export default function RoutesPage() {
|
|||||||
<TextInput
|
<TextInput
|
||||||
label="Name"
|
label="Name"
|
||||||
value={form.name}
|
value={form.name}
|
||||||
onChange={(e) => setForm((current) => ({ ...current, name: e.currentTarget.value }))}
|
onChange={(e) => {
|
||||||
|
// Capture the value before the state updater runs — React may
|
||||||
|
// recycle the synthetic event, nulling currentTarget by the time
|
||||||
|
// the updater executes ("Cannot read properties of null").
|
||||||
|
const name = e.currentTarget.value;
|
||||||
|
setForm((current) => ({ ...current, name }));
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Group justify="space-between">
|
<Group justify="space-between">
|
||||||
<Text size="sm" fw={500}>
|
<Text size="sm" fw={500}>
|
||||||
|
|||||||
Reference in New Issue
Block a user