-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(tabs): support pagination in nav bar #16055
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
Conversation
c3e79c0
to
603d68a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform); | ||
} | ||
|
||
protected _itemSelected() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be optional in the abstract class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently optional abstract methods aren't supported by TS. I can mark it as optional, but it still requires it to be defined on the sub-class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one request: can you add an example for the nav so that it either starts with many labels or a way to dynamically add/remove labels? Would be nice to have an example that shows pagination easily.
603d68a
to
5570882
Compare
Reworked based on the feedback. |
Looks like we've got an issue when the nav bar's active link is not the first link. We are calling |
You can replicate the issue in our demo app by setting the active link to the second or third link rather than defaulting to the first. You'll see the ink bar positioned under the first link. |
5570882
to
9f1f03a
Compare
Thank you @andrewseguin. I've updated it to account for |
A couple tests seem to be failing a11y checks with the following error:
|
9f1f03a
to
4679a72
Compare
Fixed @mmalerba. Looks like a copied a little bit too much from the regular tab header template. Also do we have those a11y checks running on the CI somewhere? I had to run the Chrome extension to see the failure. |
I filed #16271 for setting up axe tests, @josephperrott is going to look into it |
4679a72
to
d50b051
Compare
Adds support for pagination to `mat-tab-nav-bar` by moving some code around so that it can be reused from the `mat-tab-group`. Fixes angular#2177.
d50b051
to
092c7b3
Compare
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. |
Adds support for pagination to
mat-tab-nav-bar
by moving some code around so that it can be reused from themat-tab-group
.Fixes #2177.
Some outstanding questions:
tabindex
inmat-tab-nav-bar
? Currently all enabled links havetabindex="0"
, but now that we support keyboard navigation, we could switch to the same approach asmat-tab-group
.mat-tab-nav-bar
andmat-tab-header
. This means that these styles will be included twice and I don't think there's a nice way around it. We can include the same file throughstyleUrls
, however our style inlining won't de-duplicate the styles in that case either.