Skip to content

Commit

Permalink
fix(comp:contro-trigger): overlay closes when scrolling with virtual …
Browse files Browse the repository at this point in the history
…scroll (#1978)
  • Loading branch information
sallerli1 authored Jul 30, 2024
1 parent 0778970 commit c2944df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export default defineComponent({

resetTriggerFocus()
})
useEventListener(popperElRef, 'wheel', () => {
if (overlayFocused.value) {
resetTriggerFocus()
}
})

onMounted(() => {
bindOverlayMonitor(overlayRef, overlayOpened)
Expand Down
9 changes: 8 additions & 1 deletion packages/pro/tag-select/src/content/TagDataEditPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ export default defineComponent({
handleTagDataRemove(props.data)
}

const handlePanelMousedown = (evt: MouseEvent) => {
if (!(evt.target instanceof HTMLInputElement)) {
evt.preventDefault()
evt.stopImmediatePropagation()
}
}

const renderColorItem = (prefixCls: string, color: TagSelectColor) => {
const isSelected = color.key === props.data.color.key
const colorItemPrefixCls = `${prefixCls}-item`
Expand Down Expand Up @@ -113,7 +120,7 @@ export default defineComponent({
const prefixCls = `${mergedPrefixCls.value}-edit-panel`

return (
<div class={[prefixCls, globalHashId.value, hashId.value]}>
<div class={[prefixCls, globalHashId.value, hashId.value]} onMousedown={handlePanelMousedown}>
<div class={`${prefixCls}-input`}>
<IxFormItem
messageTooltip
Expand Down

0 comments on commit c2944df

Please sign in to comment.