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

Tree: no slot's data for nodetoggleicon template when node is loading #6371

Closed
mehdirande opened this issue Sep 10, 2024 · 0 comments
Closed
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@mehdirande
Copy link

Describe the bug

In version 3.5, the Tree component had two different slots for managing the toggler icon:

  • togglericon: This slot managed the toggler icon, with slot data including node of type TreeNode and expand of type boolean.
  • nodetogglericon: This slot was only displayed if the node was in "loading" state and in loadingMode icon, without any slot data.

In version 4, these two slots were merged into a single slot, nodetoggleicon, which is supposed to accept slot data including node of type TreeNode and expand of type boolean according to the typing.

However, when in loading mode is set to icon, no slot data is provided to nodetoggleicon when node.loading = true, making it difficult to determine that the node is in loading state.

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-zpn5oz?file=src%2FApp.vue

PrimeVue version

4.0.6

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Click on expand on the Node
  2. Check console log : TypeError: node is undefined

Expected behavior

The node and expanded properties should be provided even in loading state.

@mehdirande mehdirande added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 10, 2024
mehdirande pushed a commit to mehdirande/primevue that referenced this issue Sep 10, 2024
Nodetoggleicon slot is used to customize expand / collapse and loading
icon, but when loading mode is set to icon mode and a node is loading,
TreeNode use nodetoggleicon without any props instead of binding node and
expanded.
This commit bind node and expanded props to nodetoggleicon slot when
loading mode is set to icon and node.loading is true.
@tugcekucukoglu tugcekucukoglu added this to the 4.1.0 milestone Sep 24, 2024
@tugcekucukoglu tugcekucukoglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 24, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Sep 24, 2024
tugcekucukoglu added a commit that referenced this issue Sep 24, 2024
…ree-nodetoggleicon

Fix #6371: Add node and expanded data on nodetoggleicon.
@tugcekucukoglu tugcekucukoglu removed their assignment Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants