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

Component: TabView #16076

Closed
mastersys-giovanni opened this issue Jul 22, 2024 · 1 comment · Fixed by #16110 · 4 remaining pull requests
Closed

Component: TabView #16076

mastersys-giovanni opened this issue Jul 22, 2024 · 1 comment · Fixed by #16110 · 4 remaining pull requests
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mastersys-giovanni
Copy link

Describe the bug

When closing a tab, the marking indicating that it is selected becomes incorrect

Environment

Primeng TaView Closeable Sample

Reproducer

https://primeng.org/tabview#closable

Angular version

18

PrimeNG version

17.18.5

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Sample Primeng

Browser(s)

Chrome

Steps to reproduce the behavior

1 - Open https://primeng.org/tabview#closable
2 - Select the third tab
3 - Close the second tab
4 - See that the marking remains on the third tab, even though it doesn't exist

Expected behavior

4 - Marking should go to tab 2

@mastersys-giovanni mastersys-giovanni added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 22, 2024
@mastersys-giovanni
Copy link
Author

mastersys-giovanni commented Jul 25, 2024

closeTab(tab: TabPanel) {
if (tab.disabled) {
return;
}
if (tab.selected) {
this.tabChanged = true;
tab.selected = false;
for (let i = 0; i < this.tabs.length; i++) {
let tabPanel = this.tabs[i];
if (!tabPanel.closed && !tab.disabled) {
tabPanel.selected = true;
break;
}
}
} else { //here is update
this.tabChanged = true;
}

tab.closed = true;

}

@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jul 26, 2024
@mehmetcetin01140 mehmetcetin01140 self-assigned this Jul 26, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.18.7 milestone Jul 26, 2024
cetincakiroglu added a commit that referenced this issue Aug 1, 2024
Fixed #16076 - TabView | When closing a tab, the marking indicating t…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment