Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TreeSelect): prevent event propagation when clicking overlay #6758

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading