Skip to content

fix: interpolate cell text in HighlightCellText's no-query branch - #5433

Open
zigzagdev wants to merge 1 commit into
uber:mainfrom
zigzagdev:fix/data-table-highlight-cell-text
Open

zigzagdev wants to merge 1 commit into
uber:mainfrom
zigzagdev:fix/data-table-highlight-cell-text

Conversation

@zigzagdev

Copy link
Copy Markdown
Contributor

Motivation

HighlightCellText's no query branch was returning the literal JSX text "props.text" instead of the actual prop value, because {props.text} had been written as plain text rather than an expression.
Through the component's only two current callers (StringColumn and CategoricalColumn) this branch is guarded by a truthy check on the same query value before the component is ever invoked, so today it behaves as dead code rather than a live regression.
Still, the implementation itself is unambiguously wrong, and anyone exercising this component directly, through a future caller that doesn't add that guard, or through a direct unit test, would see the broken output.
Fixing it now closes that gap before it can surface as a real bug.

Description

Changed the no query branch in src/data-table/text-search.tsx to render {props.text} instead of the literal string props.text.
Added a direct regression test for HighlightCellText covering both the no query and active query render paths, since the existing test-search.test.ts file only exercised the splitByQuery helper and never rendered this component directly.

Scope

Patch (Bug Fix)

…is active

The no-query branch returned the literal JSX text "props.text" instead of
the prop's value, since {props.text} was written as plain text instead of
an expression. Add a direct regression test for both the no-query and
active-query render paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant