clear on focus

This commit is contained in:
madarsbiss 2021-07-17 12:42:22 +03:00
parent 2d8bb46a73
commit 49c8e91266
2 changed files with 14 additions and 11 deletions

View File

@ -38,15 +38,16 @@ export default function Home() {
{Math.round(weatherData.main.temp)}°
</h1>
<p>Feels like {weatherData.main.feels_like}°</p>
</>
)}
<input
className={styles.search}
defaultValue="Search city"
type="text"
onFocus={(e) => (e.target.value = "")}
onChange={(e) => setInput(e.target.value)}
/>
<button onClick={clickHandler}>Send</button>
</>
)}
<button onClick={clickHandler}>Search</button>
</div>
);
}

View File

@ -12,10 +12,12 @@
.search {
margin-top: 300px;
height: 30px;
width: 200px;
border-radius: 10px;
border: none;
height: 40px;
width: 300px;
border-radius: 5px;
border: 1px solid rgb(209, 209, 252);
color: rgb(224, 237, 241);
padding: 0 10px;
color: grey;
}