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: Replace single quotes in search bar as well as search history since it interferes with results. #723

Closed
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
6 changes: 3 additions & 3 deletions src/common/NavBar/HorizontalNavBar/SearchBar/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const SearchBar = React.memo(({ className, query, active }) => {
}, [searchHistoryOnClose]);

const queryInputOnChange = React.useCallback(() => {
const value = searchInputRef.current.value;
const value = searchInputRef.current.value.replaceAll(/'/g, '');
setCurrentQuery(value);
openHistory();
try {
Expand All @@ -61,7 +61,7 @@ const SearchBar = React.memo(({ className, query, active }) => {

const queryInputOnSubmit = React.useCallback((event) => {
event.preventDefault();
const searchValue = `/search?search=${event.target.value}`;
const searchValue = `/search?search=${event.target.value.replaceAll(/'/g, '')}`;
setCurrentQuery(searchValue);
if (searchInputRef.current && searchValue) {
window.location.hash = searchValue;
Expand Down Expand Up @@ -140,7 +140,7 @@ const SearchBar = React.memo(({ className, query, active }) => {
</div>
{
searchHistory.items.slice(0, 8).map(({ query, deepLinks }, index) => (
<Button key={index} className={styles['item']} href={deepLinks.search} onClick={closeHistory}>
<Button key={index} className={styles['item']} href={deepLinks.search.replaceAll(/'/g, '')} onClick={closeHistory}>
{query}
</Button>
))
Expand Down