Skip to content

Commit

Permalink
fix(pro:search): onItemRemove should emit searchValue (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 authored Aug 30, 2022
1 parent 023f57a commit 5fc5ea1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pro/search/src/composables/useSearchStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ export function useSearchStates(
}

const stateIndex = searchStates.value.findIndex(state => state.key === key)
const searchValue = searchValues.value?.find(value => value.key === key)

if (stateIndex < 0) {
return
}

const searchValue = _convertStateToValue(searchStates.value[stateIndex])
searchStates.value.splice(stateIndex, 1)
callEmit(props.onItemRemove, searchValue!)
updateSearchValue()
Expand Down

0 comments on commit 5fc5ea1

Please sign in to comment.