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

Conversation

KumJungMin
Copy link
Contributor

Defect Fixes


How to resolve

Cause

  • In "appendTo: self" mode, clicking the overlay expand icon causes the overlay to close unexpectedly.
  • This happens because clicking the expand icon triggers the onClick event of the container ref.

Resolved

  • I have prevented event propagation when clicking the overlay in "appendTo: self" mode.
<TSTree
  @click.stop  // added
 ... 
/>

Test

sample code
<template>
  <div class="card flex justify-center">
      <TreeSelect v-model="selectedValue" :options="nodes" placeholder="Select Item" class="md:w-80 w-full" append-to="self" />
  </div>
</template>

<script>
import { NodeService } from '/service/NodeService';

export default {
  data() {
      return {
          nodes: null,
          selectedValue: null
      };
  },
  mounted() {
      NodeService.getTreeNodes().then((data) => (this.nodes = data));
  }
};
</script>

Before: when clicking expand or collapse icon, the overlay is closed :(

2024-11-10.6.46.57.mov

After: when clicking expand or collapse icon, the overlay is not closed :)

2024-11-10.6.46.12.mov

Copy link

vercel bot commented Nov 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2024 9:51am
primevue-v3 ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2024 9:51am

@KumJungMin KumJungMin changed the title fix: prevent event propagation when clicking overlay in appendTo self… fix(TreeSelect): prevent event propagation when clicking overlay Nov 10, 2024
@tugcekucukoglu tugcekucukoglu merged commit a2652a9 into primefaces:master Nov 13, 2024
2 of 4 checks passed
@KumJungMin KumJungMin deleted the fix/issue-4927 branch November 15, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeSelect: appendTo="self" and selectionMode="checkbox" causes panel to close on click on node arrows
2 participants