From c8377958a890e360fbd565f3bbdb9d16d9865aa5 Mon Sep 17 00:00:00 2001 From: Marshal Date: Thu, 25 Jun 2026 00:48:14 +0000 Subject: [PATCH] fix(routes): prevent synthetic event recycling issue in name input handler --- .../backoffice/src/pages/fleet/RoutesPage.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/edr-freight-web/backoffice/src/pages/fleet/RoutesPage.tsx b/apps/edr-freight-web/backoffice/src/pages/fleet/RoutesPage.tsx index 7d530697f..30acf50ba 100644 --- a/apps/edr-freight-web/backoffice/src/pages/fleet/RoutesPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/fleet/RoutesPage.tsx @@ -408,7 +408,13 @@ export default function RoutesPage() { 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 })); + }} />