Skip to content

Commit

Permalink
Merge pull request #190 from davipguimaraes/master
Browse files Browse the repository at this point in the history
fix: add search suggestion event to click in suggestion attribute list
  • Loading branch information
danzanzini authored Oct 5, 2023
2 parents f302f4b + 7aed44f commit c94ff45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface IAttributeProps {
onMouseOver: (ee: React.MouseEvent | React.FocusEvent, item: Item) => void
onMouseOut: () => void
closeModal: () => void
onItemClick: (term: string, position: number) => void
}

const Attribute = (props: IAttributeProps) =>
Expand All @@ -27,7 +28,10 @@ const Attribute = (props: IAttributeProps) =>
className={`${stylesCss.itemListSubItemLink} c-on-base`}
to={`/${props.item.value}/${attribute.value}`}
query={`map=ft,${attribute.key}`}
onClick={() => props.closeModal()}
onClick={() => {
props.closeModal()
props.onItemClick(attribute.label, index)
}}
>
{attribute.label}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class ItemList extends React.Component<ItemListProps> {
onMouseOver={this.handleMouseOver}
onMouseOut={this.handleMouseOut}
closeModal={this.props.closeModal}
onItemClick={this.props.onItemClick}
/>
</li>
)
Expand Down

0 comments on commit c94ff45

Please sign in to comment.