Skip to content

Commit

Permalink
chore: testing a change with the input click with the useOutsideClick
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Sep 29, 2023
1 parent 56ed420 commit 704f449
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/forms/filters/InputSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export function InputSearch({
top,
onResultClick,
}: BookSearchResultsType) {
const containerRef = useRef<HTMLDivElement>(null);
// const containerRef = useRef<HTMLDivElement | HTMLInputElement>(null);
const containerRef = useRef(null);
const colorIcons = useColorModeValue('gray.700', 'gray.300');
const bgInput = useColorModeValue('white', 'black');
const colorInput = useColorModeValue('gray.900', 'gray.100');
Expand All @@ -70,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 Expand Up @@ -129,7 +130,7 @@ export function InputSearch({

return (
<>
<FormControl w={width} mr={{ base: 0, lg: 2 }}>
<FormControl w={width} mr={{ base: 0, lg: 2 }} ref={containerRef}>
<InputGroup>
<InputLeftElement>
<Icon as={FiSearch} boxSize='20px' color={colorIcons} />
Expand Down Expand Up @@ -184,7 +185,6 @@ export function InputSearch({
p='4'
bg={colorContainerBg}
color={colorContainer}
ref={containerRef}
fontWeight='500'
position={{ base: 'inherit', md: 'absolute' }}
top={top}
Expand Down

1 comment on commit 704f449

@vercel
Copy link

@vercel vercel bot commented on 704f449 Sep 29, 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-franqsanz.vercel.app
xbu-git-main-franqsanz.vercel.app
xbu.vercel.app

Please sign in to comment.