Skip to content

Commit f5693d8

Browse files
massahoudoumassahoudou
authored andcommitted
refacto: change isSearchEmpty state after clicking on Clear Button
1 parent d072b4b commit f5693d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/Hero.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function Hero() {
1717
const handleClear: MouseEventHandler<HTMLButtonElement> = () => {
1818
if (formRef.current && !isSearchEmpty) {
1919
formRef.current.reset();
20+
setIsSearchEmpty(true);
2021
setErrorMessage(null);
2122
}
2223
};
@@ -47,7 +48,7 @@ function Hero() {
4748
onSubmit={handleSubmit}
4849
>
4950
<div className="flex w-full">
50-
<div className="flex relative">
51+
<div className="flex relative w-full ">
5152
<input
5253
type="text"
5354
placeholder="Search for your language"

0 commit comments

Comments
 (0)