From b7b7379fd97e313f268a0096a95e04bb1b7e5e15 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2026 22:40:58 +0000 Subject: [PATCH 1/2] fix(inputGroup): Prevent maximum update depth exceeded in Leading/TrailingItems --- .../app/components/core/input/inputGroup.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/static/app/components/core/input/inputGroup.tsx b/static/app/components/core/input/inputGroup.tsx index efb09245f5aa..027af9d77762 100644 --- a/static/app/components/core/input/inputGroup.tsx +++ b/static/app/components/core/input/inputGroup.tsx @@ -213,8 +213,15 @@ function LeadingItems({children, disablePointerEvents, ...props}: InputItemsProp if (!ref.current) { return; } - setLeadingWidth?.(ref.current.offsetWidth); - }, [children, setLeadingWidth, size]); + const observer = new ResizeObserver(entries => { + const width = entries[0]?.borderBoxSize[0]?.inlineSize ?? ref.current?.offsetWidth; + if (width !== undefined) { + setLeadingWidth?.(width); + } + }); + observer.observe(ref.current); + return () => observer.disconnect(); + }, [setLeadingWidth]); return ( { + const width = entries[0]?.borderBoxSize[0]?.inlineSize ?? ref.current?.offsetWidth; + if (width !== undefined) { + setTrailingWidth?.(width); + } + }); + observer.observe(ref.current); + return () => observer.disconnect(); + }, [setTrailingWidth]); return ( Date: Sun, 2 Aug 2026 23:42:35 +0000 Subject: [PATCH 2/2] fix(inputgroup): Prevent infinite re-render loop in Leading/TrailingItems --- .../app/components/core/input/inputGroup.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/static/app/components/core/input/inputGroup.tsx b/static/app/components/core/input/inputGroup.tsx index 027af9d77762..73e6a97f6077 100644 --- a/static/app/components/core/input/inputGroup.tsx +++ b/static/app/components/core/input/inputGroup.tsx @@ -213,13 +213,13 @@ function LeadingItems({children, disablePointerEvents, ...props}: InputItemsProp if (!ref.current) { return; } - const observer = new ResizeObserver(entries => { - const width = entries[0]?.borderBoxSize[0]?.inlineSize ?? ref.current?.offsetWidth; - if (width !== undefined) { - setLeadingWidth?.(width); + const el = ref.current; + const observer = new ResizeObserver(() => { + if (el) { + setLeadingWidth?.(el.offsetWidth); } }); - observer.observe(ref.current); + observer.observe(el); return () => observer.disconnect(); }, [setLeadingWidth]); @@ -255,13 +255,13 @@ function TrailingItems({children, disablePointerEvents, ...props}: InputItemsPro if (!ref.current) { return; } - const observer = new ResizeObserver(entries => { - const width = entries[0]?.borderBoxSize[0]?.inlineSize ?? ref.current?.offsetWidth; - if (width !== undefined) { - setTrailingWidth?.(width); + const el = ref.current; + const observer = new ResizeObserver(() => { + if (el) { + setTrailingWidth?.(el.offsetWidth); } }); - observer.observe(ref.current); + observer.observe(el); return () => observer.disconnect(); }, [setTrailingWidth]);