Skip to content

Commit

Permalink
Fix off-by-1 error in accessing suggestion indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspun-wandb committed Oct 18, 2024
1 parent a8af605 commit f44633a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions weave-js/src/panel/WeaveExpression/suggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ export const Suggestions = (props: SuggestionProps) => {
{Object.keys(items).map(suggestionCategory => (
<React.Fragment key={suggestionCategory}>
<S.SuggestionCategory>{suggestionCategory}</S.SuggestionCategory>
{items[suggestionCategory].map((s: any) => {
itemIndex++;
{items[suggestionCategory].map((suggestion: any) => {
const currentIndex = itemIndex++;
return (
<SuggestionRow
key={itemIndex}
idx={itemIndex}
suggestion={s}
key={currentIndex}
idx={currentIndex}
suggestion={suggestion}
takeSuggestion={takeSuggestion}
suggestionIndex={props.suggestionIndex}
setSuggestionIndex={props.setSuggestionIndex}
Expand Down

0 comments on commit f44633a

Please sign in to comment.