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

TabView: Dynamic Tabs not working #5229

Closed
elliotspall opened this issue Nov 2, 2023 · 2 comments · Fixed by #5239
Closed

TabView: Dynamic Tabs not working #5229

elliotspall opened this issue Nov 2, 2023 · 2 comments · Fixed by #5239
Labels
Type: Bug Issue contains a defect related to a specific component. Type: Performance Issue is performance or optimization related
Milestone

Comments

@elliotspall
Copy link
Contributor

Describe the bug

When using state to track of dynamic tabs, there is bug that arises when you create a tab (let's say with a header "12"), close that tab, and then try to create a new tab with the same name / header. In the code sandbox example I log the state array to the console, and whilst the state array correctly updates and adds the new tab, the TabView does not show the new tab. If you create a new tab with a different name, it gets created.

Reproducer

https://codesandbox.io/s/primereact-demo-forked-ttl6sd?file=/src/App.js:901-1008

PrimeReact version

10.0.9

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

1: Enter a value in the input field and observe how a tab with a header matching your input is created.
2: (Optional) Create a few tabs if you want.
3: Close any one of your tabs.
4: Try to create a new tab with the same input as the tab you just closed.
5: Observe how despite the state updating correctly, the tab is not added back to the TabView UI.

Expected behavior

You should be able to add back tabs that you close.

@elliotspall elliotspall added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 2, 2023
@elliotspall elliotspall changed the title TabView Dynamic Tabs not working TabView: Dynamic Tabs not working Nov 2, 2023
@melloware
Copy link
Member

Isn't that related or the same as this: #2842

@elliotspall
Copy link
Contributor Author

elliotspall commented Nov 3, 2023

Isn't that related or the same as this: #2842

Probably, I think these issues are all related. This particular issue however isn't related to multiple tabs being closed, but rather not being able to create a new tab after closing one.

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 3, 2023
@melloware melloware added the Type: Performance Issue is performance or optimization related label Nov 5, 2023
@melloware melloware added this to the 10.0.10 milestone Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component. Type: Performance Issue is performance or optimization related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants