Skip to content

Commit

Permalink
fix(pro:search): error when deleting previsous item with backspace (#…
Browse files Browse the repository at this point in the history
…1130)

error when previousState doesn't exist
  • Loading branch information
sallerli1 committed Sep 13, 2022
1 parent 367e0bc commit 670033c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pro/search/src/searchItem/Segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function useInputEvents(
const currentStateIndex = searchStates.value.findIndex(state => state.key === props.itemKey)
const previousState = searchStates.value[currentStateIndex - 1]

if (previousState.key) {
if (previousState?.key) {
removeSearchState(previousState.key)
}
}
Expand Down

0 comments on commit 670033c

Please sign in to comment.