Skip to content

Commit

Permalink
[dagit] Fix global search for repeated item keys (#7827)
Browse files Browse the repository at this point in the history
### Summary & Motivation

There is currently a bug where users who have jobs/sensors/schedules that share the same name end up with a broken global search experience because keys are repeated.

To repair this, use `href`, which should be guaranteed unique for various objects, even if they have the same name.

### How I Tested These Changes

View Dagit as a user with repeated object names for jobs/sensors. Open global search, verify that rendering and behavior (typing, key navigation) is correct when searching for a name that would have previously collided.
  • Loading branch information
hellendag committed May 10, 2022
1 parent 14947c2 commit 99259a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const SearchResults = (props: Props) => {
<List hasResults={!!results.length}>
{results.map((result, ii) => (
<SearchResultItem
key={result.item.key}
key={result.item.href}
isHighlight={highlight === ii}
result={result}
onClickResult={onClickResult}
Expand Down

0 comments on commit 99259a7

Please sign in to comment.