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

AccordionTab is beeing removed from DOM on closing Tab #6543

Open
kingmauri opened this issue May 2, 2024 · 0 comments
Open

AccordionTab is beeing removed from DOM on closing Tab #6543

kingmauri opened this issue May 2, 2024 · 0 comments
Assignees
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@kingmauri
Copy link

Describe the bug

When using the accordion component, the tab is removed from the DOM once it is closed. This could be problematic, for example, when forms and input fields are used as content, as the content of the input field is deleted when closing and reopening. Of course, one could store the content of the field in a useState (as in the example), but the problem with form validation persists because only the fields of the current tab are validated, not all of them. The entire form cannot be validated if there are form fields in the different accordion tabs.

I compared the component with other libraries like PrimeVue and PrimeNG, where the content of the DOM is NOT deleted. Is there a simple way to prevent the accordion tab from being removed from the DOM when the tab is closed?

Reproducer

https://stackblitz.com/edit/rdg6zx-hjxnyv?file=src%2FApp.jsx

PrimeReact version

10.6.4

React version

17.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@kingmauri kingmauri added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 2, 2024
@nitrogenous nitrogenous self-assigned this May 2, 2024
@nitrogenous nitrogenous added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Core Team Issue or pull request has been *opened* by a member of Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants