Skip to content

Commit

Permalink
chore: minor changes in the search input
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Oct 3, 2023
1 parent 704f449 commit f753e72
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/forms/filters/InputSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { useDebounce } from '../../../hooks/useDebounce';
import { BookSearchResultsType } from '../../../components/types';

function highlightText(text, query) {
const regex = new RegExp(`(${query})`, 'gi');
const regex = new RegExp(`(${query.trim()})`, 'gi');
return text
.split(regex)
.map((part, index) =>
Expand Down Expand Up @@ -71,11 +71,11 @@ export function InputSearch({

useOutsideClick({
ref: containerRef,
// handler: () => {
// if (search.query) {
// setSearch({ ...search, query: '' });
// }
// },
handler: () => {
if (search.query) {
setSearch({ ...search, query: '' });
}
},
});

useEffect(() => {
Expand Down

1 comment on commit f753e72

@vercel
Copy link

@vercel vercel bot commented on f753e72 Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

xbu – ./

xbu.vercel.app
xbu-git-main-franqsanz.vercel.app
xbu-franqsanz.vercel.app

Please sign in to comment.