Skip to content

Commit

Permalink
add required to input and onSubmit to form and remove onSubmit from b…
Browse files Browse the repository at this point in the history
…utton (reactplay#588)
  • Loading branch information
muzaffar640 committed Oct 5, 2022
1 parent aa7ed53 commit c80cf3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plays/git-hub-profile-search/components/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const Input = () => {
}

return (
<form className='nirban-github-profile-form'>
<input tabIndex={0} autoFocus value={username} placeholder="Search Username" onChange={(e) => setUsername(e.target.value)} className="nirban-github-profile-search" />
<button type="submit" onClick={handleSubmit} className="nirban-github-profile-btn">
<form className='nirban-github-profile-form' onSubmit={handleSubmit} >
<input tabIndex={0} autoFocus value={username} required placeholder="Search Username" onChange={(e) => setUsername(e.target.value)} className="nirban-github-profile-search" />
<button type="submit" className="nirban-github-profile-btn">
Search
</button>
</form>
Expand Down

0 comments on commit c80cf3a

Please sign in to comment.