Skip to content

fix(material/tabs): use buttons for paginator #14640

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

Merged
merged 1 commit into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/material/tabs/_tabs-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ $tab-animation-duration: 500ms !default;
z-index: 2;
-webkit-tap-highlight-color: transparent;
touch-action: none;
box-sizing: content-box;
background: none;
border: none;
outline: 0;
padding: 0;

&::-moz-focus-inner {
border: 0;
}

.mat-tab-header-pagination-controls-enabled & {
display: flex;
Expand Down
20 changes: 14 additions & 6 deletions src/material/tabs/tab-nav-bar/tab-nav-bar.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<div class="mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4"
<button class="mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4"
#previousPaginator
aria-hidden="true"
mat-ripple [matRippleDisabled]="_disableScrollBefore || disableRipple"
type="button"
mat-ripple
tabindex="-1"
[matRippleDisabled]="_disableScrollBefore || disableRipple"
[class.mat-tab-header-pagination-disabled]="_disableScrollBefore"
[disabled]="_disableScrollBefore || null"
(click)="_handlePaginatorClick('before')"
(mousedown)="_handlePaginatorPress('before', $event)"
(touchend)="_stopInterval()">
<div class="mat-tab-header-pagination-chevron"></div>
</div>
</button>

<div class="mat-tab-link-container" #tabListContainer (keydown)="_handleKeydown($event)">
<div
Expand All @@ -22,13 +26,17 @@
</div>
</div>

<div class="mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4"
<button class="mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4"
#nextPaginator
aria-hidden="true"
mat-ripple [matRippleDisabled]="_disableScrollAfter || disableRipple"
type="button"
mat-ripple
[matRippleDisabled]="_disableScrollAfter || disableRipple"
[class.mat-tab-header-pagination-disabled]="_disableScrollAfter"
[disabled]="_disableScrollAfter || null"
tabindex="-1"
(mousedown)="_handlePaginatorPress('after', $event)"
(click)="_handlePaginatorClick('after')"
(touchend)="_stopInterval()">
<div class="mat-tab-header-pagination-chevron"></div>
</div>
</button>