-
Notifications
You must be signed in to change notification settings - Fork 82
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
searchFn callback fires twice when typing in search bar #101
Comments
Any solution? |
If you're looking for an easy solution to wrap this for now, you could either debounce, or just do this:
That way you have pretty much the same solution that a componentDidUpdate with an equality check would give you. Edited Sandbox here: https://codesandbox.io/s/searchfn-callback-issue-glbzx?file=/src/App.js |
I am extremely out of time recently, so if someone can submit a patch for this it could be great. If not it would have to wait a bit. Apologies if inconvenient. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
…ing in the search bar (#131) * Working searchFn example. * Remove debug code. * Undo indentation * Restore changes. * Remove debug code. * Restore return. * Add test for a custom function. * Add test coverage for custom search function. * Apply code review suggestions.
reverted for now |
…ing in the search bar, #134, #133 (#136) * Working searchFn example. * Remove debug code. * Undo indentation * Restore changes. * Remove debug code. * Restore return. * Add test for a custom function. * Add test coverage for custom search function. * Apply code review suggestions. * Reset searchResults on blur. * Clear search results on dropdown; update search results on options change.
* master: (27 commits) v4.7.0 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (searchFn)[#101] searchFn callback should only call once when typing in the search bar, #134, #133 (#136) 4.6.1 Revert "FIX (searchFn)[#101] searchFn callback should only call once when typing in the search bar (#131)" (#135) v4.6.0 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (searchFn)[#101] searchFn callback should only call once when typing in the search bar (#131) v4.5.2 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (style): Accepts a short color (#127) v4.5.1 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (duplicates)[#116]: more proper way to check dupes, closes #116 FIX (duplicates): PR comments FIX (duplicates)[#116]: more proper way to check dupes, closes #116 bump version v4.5.0 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (input) [#114]: fix chars truncated, closes #114 v4.4.2 See changelog: https://github.com/sanusart/react-dropdown-select/blob/master/CHANGELOG.md FIX (box-model): add box-sizing border-box, closes #94 (#104) Bump websocket-extensions from 0.1.3 to 0.1.4 (#102) DOCS (example): add import to example, thanks to @karland, closes #93 CHORE (types): fix keepOpen type | closes #95 (#96) ... # Conflicts: # __tests__/__snapshots__/index.spec.js.snap # __tests__/components/__snapshots__/DropdownHandle.spec.js.snap # package-lock.json # src/components/DropdownHandle.js
Hi there, I'm having a problem with the
searchFn
callback, apparently each time you type in the search bar thesearchFn
callback gets fired twice. The same thing doesn't seem to happen withhandleKeyDownFn
callback, however the state it returns is a bit late so I can't use it.I've created this sandbox here to demonstrate the issue, try typing in the search bar and then check the console.
The text was updated successfully, but these errors were encountered: