primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.69k stars 1.01k forks source link

Accordion is completely broken when set unmountOnExit to false #6668

Open vnts7 opened 4 months ago

vnts7 commented 4 months ago

Describe the bug

As title: Accordion is completely broken when set unmountOnExit to false

Reproducer

https://stackblitz.com/edit/vitejs-vite-g6tzer?file=src%2FApp.tsx

PrimeReact version

10.6.5

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

melloware commented 4 months ago

Do you mind if I ask what you are trying to do? Why do you want to unmount the component when its animated?

vnts7 commented 4 months ago

Do you mind if I ask what you are trying to do? Why do you want to unmount the component when its animated?

Hi, what I'm trying to do is to NOT unmount the component. In my case: because I have some form validation that need to be trigger even when Accordion is not expanded When unmountOnExit is true, the form will be unmount when the Accordion is not expanded and the validation will not trigger

vnts7 commented 4 months ago

This is similar with the lazy prop in PrimeVue To have the option to render or not the hidden tab https://primevue.org/accordion/#api.accordion.props.lazy