Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table with multiple badges not triggering the correct search #767

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ const ActionableBadge: React.FC<ActionableBadgeProps> = ({
};

export class BadgeList extends React.Component<BadgeListProps> {
idx = 0;

handleClick = (e) => {
const badgeText = this.props.badges[this.idx].badge_name
? this.props.badges[this.idx].badge_name
: this.props.badges[this.idx].tag_name;
handleClick = (index: number, e) => {
const badgeText = this.props.badges[index].badge_name
allisonsuarez marked this conversation as resolved.
Show resolved Hide resolved
? this.props.badges[index].badge_name
: this.props.badges[index].tag_name;
logClick(e, {
target_type: 'badge',
label: badgeText,
Expand Down Expand Up @@ -98,12 +96,11 @@ export class BadgeList extends React.Component<BadgeListProps> {
<ActionableBadge
displayName={badgeConfig.displayName}
style={badgeConfig.style}
action={this.handleClick}
action={(e) => this.handleClick(index, e)}
key={`badge-${index}`}
/>
);
}
this.idx++;
})}
</span>
);
Expand Down