Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/catalog-search/src/SearchBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const SearchBoxBase = ({
setAutocompleteHits(hits);
setShowSuggestions(true);
}
} else {
} else if (isMounted) {
setShowSuggestions(false);
}
}, 1000);
Expand Down
5 changes: 2 additions & 3 deletions packages/catalog-search/src/SearchSuggestionItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';

const SearchSuggestionItem = ({
title, url, highlightedTitle, authoringOrganization, programType,
url, highlightedTitle, authoringOrganization, programType,
}) => (
<Link to={url} key={title} className="suggestion-item">
<Link to={url} className="suggestion-item">
<div>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: highlightedTitle }} />
Expand All @@ -29,7 +29,6 @@ const SearchSuggestionItem = ({
);

SearchSuggestionItem.propTypes = {
title: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
highlightedTitle: PropTypes.string.isRequired,
authoringOrganization: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions packages/catalog-search/src/SearchSuggestions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SearchSuggestions = ({ autoCompleteHits, enterpriseSlug, handleViewAllClic
/* eslint-disable-next-line no-underscore-dangle */
highlightedTitle={hit._highlightResult.title.value}
authoringOrganization={hit.key && hit.key.split('+')[0]}
title={hit.title}
key={hit.title}
/>
))
}
Expand All @@ -41,7 +41,7 @@ const SearchSuggestions = ({ autoCompleteHits, enterpriseSlug, handleViewAllClic
/* eslint-disable-next-line no-underscore-dangle */
highlightedTitle={hit._highlightResult.title.value}
authoringOrganization={hit.authoring_organizations && hit.authoring_organizations[0].key}
title={hit.title}
key={hit.title}
programType={hit.program_type}
/>
))
Expand Down