-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Control method for tab close #1075
Comments
@cagataycivici I see that you implemented the Though, for some reason, I am getting primeng --- v. ^9.0.5 Unfortunately, I need this functionality to work in order to capture the |
Put [controlClose] in p-tabView instead of p-tabPanel |
I recently faced the same issue, the problem is the (onClose) does not work on p-tabPanel, it works on p-tabView only so we need to use the (onClose) on p-tabView only and pass an Event the event gives the index of tab to be removed and then we can remove the tab in our .ts code, i am providing code snippet below for better understanding <p-tabView (onClose)="onTabClose($event)" [controlClose]="true"> import { Component, OnInit } from '@angular/core'; @component({ ngOnInit(): void {} onTabClose(event: TabViewCloseEvent) {
} In PrimeNG, when you click the close icon on a tab (using p-tabPanel inside p-tabView), the following happens: The onClose event is triggered. Hope, this helps!! |
When a tab is clicked for close, give the page author a way to decide if the tab can be closed. Add new boolean attribute called controlClose and when true, pass a callback as the 3rd parameter in onClose, if the page author decided to close it, then callback should be invoked with callback();
The text was updated successfully, but these errors were encountered: