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

Console error each time I click the searchbar #42

Closed
hugoseri opened this issue Mar 30, 2021 · 3 comments
Closed

Console error each time I click the searchbar #42

hugoseri opened this issue Mar 30, 2021 · 3 comments
Assignees

Comments

@hugoseri
Copy link

hugoseri commented Mar 30, 2021

Expected behavior

There shouldn't have any console error when clicking the searchbar.

Actuel behavior

When hovering the searchbar, I get the following console error:

main.5fef3583.js:2 Uncaught TypeError: e.handleSearchBarToggle is not a function
    at VM893 c4f5d8e4.e9d8ad2d.js:1
    at Object.l (main.5fef3583.js:2)
    at p (main.5fef3583.js:2)
    at main.5fef3583.js:2
    at b (main.5fef3583.js:2)
    at lt (main.5fef3583.js:2)
    at at (main.5fef3583.js:2)
    at ut (main.5fef3583.js:2)
    at mt (main.5fef3583.js:2)
    at F (main.5fef3583.js:2)

However, it doesn't affect the searchbar behavior, everything works perfectly.

How to fix it

I simply modified src/theme/SearchBar/index.js at line 69 with the following:

      props.handleSearchBarToggle && props.handleSearchBarToggle(!props.isSearchBarExpanded);

I didn't go too deep to find the reason why handleSearchBarToggle wasn't defined at some point but my solution seems to fix the issue.

Maybe I should add a pull request for this ? Or maybe there is a better fix ?

@lelouch77
Copy link
Collaborator

Sure, Please send a pull request.

@lelouch77
Copy link
Collaborator

fixed in v2.1.14

@joao-imi
Copy link

just found this same issue on v2.3.2

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