-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[feature] Add disabled property to md-tab #645
Comments
Further |
+1 i am looking to for a solution to disable this tabs. For everyone who is looking for a way to make the tabs not clickable:
|
Here's how to do it for
When disabled it cannot be clicked, and it also applies the class However please note if you perform an action that means that the currently selected tab should no longer be enabled you'll have to manually set selectedIndex to switch away from it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
A common UX situation requires us to disable certain areas of the view (buttons, dropdowns etc...). My use case is that certain tabs should not be accessible to the user based on a model value. A clean solution would be to have a
disabled
property on the tab, to be used like:The best alternative I could think about is very clumsy: to watch the
selectedIndex
property with asetInterval
orclick
handler, and if that becomes the index of a tab that should not be accessible, to reset it to the previous index value.If the tab group emitted a
selected
event with the index of the newly selected tab, I could bind to that instead but even that wouldn't be as clean as adisabled
property that could be data-bound.PS: I realize that
*ngIf
could be used to remove a tab from the DOM but this doesn't serve the same purpose: sometimes you need the user to be aware of the UI element that she cannot activate (just as you would disable rather than hide a form submit button)The text was updated successfully, but these errors were encountered: