Skip to content

Commit

Permalink
fix(pro:search): clicking search button should trigger value change (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed May 18, 2023
1 parent b8cada3 commit 324d74f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/pro/search/src/ProSearch.tsx
Expand Up @@ -143,9 +143,11 @@ export default defineComponent({
}
const handleSearchBtnMouseDown = (evt: MouseEvent) => {
evt.preventDefault()
evt.stopImmediatePropagation()
}
const handleClearBtnMouseDown = (evt: MouseEvent) => {
evt.preventDefault()
evt.stopImmediatePropagation()
}

provide(proSearchContext, {
Expand Down
5 changes: 3 additions & 2 deletions packages/pro/search/src/composables/useSegmentStates.ts
Expand Up @@ -188,13 +188,14 @@ export function useSegmentStates(
}
const confirmSearchItem = () => {
const key = props.searchItem!.key
const validateRes = validateSearchState(key)
const searchValue = convertStateToValue(key)

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

const validateRes = validateSearchState(key)
const searchValue = convertStateToValue(key)

if (!validateRes) {
removeSearchState(key)
} else {
Expand Down

0 comments on commit 324d74f

Please sign in to comment.