Skip to content

Commit

Permalink
Merge a2d90c3 into 97bdafb
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Aug 10, 2023
2 parents 97bdafb + a2d90c3 commit 66fb191
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineComponent({
convertStateToValue,
createSearchState,
getSearchStatesByFieldKey,
removeSearchState,
updateSegmentValue,
updateSearchValues,
tempSegmentInputRef,
Expand Down Expand Up @@ -65,6 +66,12 @@ export default defineComponent({

const confirmValue = (value: unknown) => {
let searchStateKey = searchState.value?.key

if (!value && searchStateKey) {
removeSearchState(searchStateKey)
return
}

if (!searchState.value) {
searchStateKey = createSearchState(props.searchField.key, {
value,
Expand Down
4 changes: 2 additions & 2 deletions packages/pro/search/src/components/segment/SegmentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ function useSegmentScroll(
): ComputedRef<SegmentScroll> {
const [segmentScroll, setSegmentScroll] = useState<SegmentScroll>({ left: 0, right: 0 }, true)

let listenerStops: (() => void)[]
let listenerStops: (() => void)[] | undefined
const stopListen = () => {
listenerStops.forEach(stop => stop())
listenerStops?.forEach(stop => stop())
}

const getScrolls = (): SegmentScroll => {
Expand Down

0 comments on commit 66fb191

Please sign in to comment.