Skip to content

fix(data-scrubbing): Stop source field suggestion scroll from crashing#116653

Merged
scttcper merged 3 commits into
masterfrom
scttcper/fix-source-field-scroll-crash
Jun 2, 2026
Merged

fix(data-scrubbing): Stop source field suggestion scroll from crashing#116653
scttcper merged 3 commits into
masterfrom
scttcper/fix-source-field-scroll-crash

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented Jun 1, 2026

The data scrubbing source field crashed with Cannot read properties of undefined (reading 'scrollIntoView') because arrow-key nav bounded against the full suggestion list while only the first 50 are rendered, so the active index could point past a real DOM node.

Scrolls via a callback ref on the active item instead of indexing into children, clamps nav to the rendered count, and drops some dead weight in the component (unused refs, event.persist(), the hideCaret state). Somewhat preparing this component to be rewritten as functional.

fixes JAVASCRIPT-39FH

its this modal on the security and privacy page

image

scttcper and others added 2 commits June 1, 2026 16:22
The source field in the data scrubbing modal would throw `Cannot read
properties of undefined (reading 'scrollIntoView')` and take down the
whole modal via the error boundary.

Two things stacked up. The rendered suggestion list is capped at 50
items, but arrow-key navigation bounded against the full (unsliced)
length, so on a project with more than 50 suggestions you could move the
active index past the last rendered node. The scroll then did
`children[activeSuggestion]!.scrollIntoView()` and the `!` happily
asserted away the undefined.

Swap the index-into-children scroll for a callback ref on the active item
that scrolls itself in, clamp arrow navigation to the rendered count, and
optional-call scrollIntoView so it can never throw during commit. While
in here, drop the dead selectorField/suggestionList refs, the no-op
event.persist(), the unused handler arg, and the hideCaret state (a
transparent-caret nicety that wasn't worth the surface area).

Fixes JAVASCRIPT-39FH

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The dataset radios were in a horizontal Flex row. Switch to a column so
each option sits on its own line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.59%

@scttcper scttcper requested a review from a team June 1, 2026 23:32
@scttcper scttcper marked this pull request as ready for review June 1, 2026 23:32
@scttcper scttcper requested a review from a team as a code owner June 1, 2026 23:32
@scttcper scttcper merged commit 5f63338 into master Jun 2, 2026
75 checks passed
@scttcper scttcper deleted the scttcper/fix-source-field-scroll-crash branch June 2, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants