Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search result button not working! #7

Open
itsrajshivhare opened this issue Nov 24, 2023 · 2 comments
Open

Search result button not working! #7

itsrajshivhare opened this issue Nov 24, 2023 · 2 comments

Comments

@itsrajshivhare
Copy link

The button at the end of search bar doesn't seems to working (only works on enter).

@rr-tri
Copy link

rr-tri commented Dec 16, 2023

Add

onClick={() => { navigate(`/search/${query}`) }}

on the search button

 <div className="searchInput">
                        <input
                            type="text"
                            placeholder="Search for a movie or tv show...."
                            onChange={(e) => setQuery(e.target.value)}
                            onKeyUp={searchQueryHandler}
                        />
                        <button onClick={() => { navigate(`/search/${query}`) }}>Search</button>
                    </div>

@ashutoshsabale
Copy link

create function as searchButtonHandler and pass it to button for onClick event
const searchButtonHandler = () =>{
navigate(/search/${searchQuery})
}

OfficialDeepSaha added a commit to OfficialDeepSaha/movix that referenced this issue Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants