primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.59k stars 1.23k forks source link

DataTable: Conflict between DataTable with expander and Panel #4335

Closed kubiksk8ter closed 11 months ago

kubiksk8ter commented 1 year ago

Describe the bug

When DataTable with expandable rows is inserted into default slot of Panel component and row is expanded, then DataTable mount again every expanded row component. Even in row collapse, DataTable mount every expanded row component again. Even in Panel collapse, DataTable mount every expanded row component again.

Reproducer

https://codesandbox.io/p/sandbox/cranky-tesla-xy6qh2?welcome=true

PrimeVue version

3.32.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

Click on row to expand. Click another row to expand. Now you see, both row are mounted again.

Expected behavior

Only requiring row should be mounted and on row collapse no row should be mounted.

mertsincan commented 11 months ago

Hi,

I made some changes related to the expandedRows feature. https://github.com/primefaces/primevue/issues/4977 Also, you can remove v-model: (two-way binding) from expandedRows. This type of two-way binding will always re-render the component.

Best Regards,