Skip to content

Commit

Permalink
Merge 4e4fae2 into 05fdb30
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed May 16, 2023
2 parents 05fdb30 + 4e4fae2 commit 6c80b69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/pro/search/src/composables/useSegmentStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export function useSegmentStates(
const validateRes = validateSearchState(key)
const searchValue = convertStateToValue(key)

Object.entries(segmentStates.value).forEach(([name, state]) => {
updateSegmentValue(state.value, name, key)
})

if (!validateRes) {
removeSearchState(key)
} else {
Expand All @@ -216,8 +220,7 @@ export function useSegmentStates(
if (!segmentState) {
return
}
const { value, index } = segmentState
updateSegmentValue(value, name, props.searchItem!.key)
const { index } = segmentState

// only confirm searchItem when the last segment is confirmed
// if the last segment is searchItem name, confirm the searchItem only when no searchField is selected
Expand Down

0 comments on commit 6c80b69

Please sign in to comment.