Skip to content

Commit

Permalink
fix(pro:search): select activeValue shouldn't change on mouse leave (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 authored Oct 17, 2023
1 parent b064b21 commit a6d539a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pro/search/src/panel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export default defineComponent({
callEmit(props.onSelectAllClick)
}
const handleMouseLeave = () => {
setActiveValue(undefined)
if (props.setInactiveOnMouseLeave) {
setActiveValue(undefined)
}
}

const handleKeyDown = useOnKeyDown(props, panelRef, activeValue, filteredDataSource, changeSelected, handleConfirm)
Expand Down
1 change: 1 addition & 0 deletions packages/pro/search/src/segments/CreateSelectSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function createSelectSegment(
setOnKeyDown={setOnKeyDown}
showSelectAll={renderLocation === 'individual' && showSelectAll}
showFooter={renderLocation === 'individual'}
setInactiveOnMouseLeave={renderLocation === 'quick-select-panel'}
searchValue={searchable ? searchInput : ''}
searchFn={searchFn}
onChange={handleChange}
Expand Down
1 change: 1 addition & 0 deletions packages/pro/search/src/types/panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const proSearchSelectPanelProps = {
showSelectAll: { type: Boolean, default: true },
showFooter: { type: Boolean, default: true },
autoHeight: { type: Boolean, default: false },
setInactiveOnMouseLeave: { type: Boolean, default: false },
allSelected: Boolean,
searchValue: { type: String, default: undefined },
searchFn: Function as PropType<(data: SelectPanelData, searchValue?: string) => boolean>,
Expand Down

0 comments on commit a6d539a

Please sign in to comment.