mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
cancel debounce if search is empty
This commit is contained in:
parent
2b4aec9337
commit
0810d6f8f4
@ -55,6 +55,8 @@ const ResultsTypeDecorators = {
|
|||||||
const Results = (props) => {
|
const Results = (props) => {
|
||||||
let { results } = props
|
let { results } = props
|
||||||
|
|
||||||
|
console.log("results", results, typeof results)
|
||||||
|
|
||||||
if (typeof results !== "object") {
|
if (typeof results !== "object") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@ -190,6 +192,8 @@ export default (props) => {
|
|||||||
setSearchValue(e.target.value)
|
setSearchValue(e.target.value)
|
||||||
|
|
||||||
if (e.target.value === "") {
|
if (e.target.value === "") {
|
||||||
|
debounceSearch.cancel()
|
||||||
|
|
||||||
if (props.useUrlQuery) {
|
if (props.useUrlQuery) {
|
||||||
setQuery(null)
|
setQuery(null)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user