Skip to content

Commit

Permalink
Merge pull request #6758 from KumJungMin/fix/issue-4927
Browse files Browse the repository at this point in the history
fix(TreeSelect): prevent event propagation when clicking overlay
  • Loading branch information
tugcekucukoglu authored Nov 13, 2024
2 parents e028822 + 2533cdb commit a2652a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/primevue/src/treeselect/TreeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
@node-collapse="$emit('node-collapse', $event)"
@node-select="onNodeSelect"
@node-unselect="onNodeUnselect"
@click.stop
:level="0"
:unstyled="unstyled"
:pt="ptm('pcTree')"
Expand Down Expand Up @@ -133,13 +134,13 @@ import { isEmpty, isNotEmpty } from '@primeuix/utils/object';
import { ZIndex } from '@primeuix/utils/zindex';
import { ConnectedOverlayScrollHandler, UniqueComponentId } from '@primevue/core/utils';
import ChevronDownIcon from '@primevue/icons/chevrondown';
import TimesIcon from '@primevue/icons/times';
import Chip from 'primevue/chip';
import OverlayEventBus from 'primevue/overlayeventbus';
import Portal from 'primevue/portal';
import Ripple from 'primevue/ripple';
import Tree from 'primevue/tree';
import BaseTreeSelect from './BaseTreeSelect.vue';
import TimesIcon from '@primevue/icons/times';
export default {
name: 'TreeSelect',
Expand Down Expand Up @@ -228,14 +229,14 @@ export default {
if (event.target.tagName === 'INPUT' || event.target.getAttribute('data-pc-section') === 'clearicon' || event.target.closest('[data-pc-section="clearicon"]')) {
return;
} else if (!this.disabled && (!this.overlay || !this.overlay.contains(event.target))) {
} else if (!this.overlay || !this.overlay.contains(event.target)) {
if (this.overlayVisible) this.hide();
else this.show();
focus(this.$refs.focusInput);
}
},
onClearClick(event) {
onClearClick() {
this.onSelectionChange(null);
},
onSelectionChange(keys) {
Expand Down

0 comments on commit a2652a9

Please sign in to comment.