Skip to content

fix(sort): arrow visible while parent row is being animated #11827

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
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
6 changes: 3 additions & 3 deletions src/lib/sort/sort-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export const matSortAnimations: {
arrowOpacity: trigger('arrowOpacity', [
state('desc-to-active, asc-to-active, active', style({opacity: 1})),
state('desc-to-hint, asc-to-hint, hint', style({opacity: .54})),
state('hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc',
state('hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void',
style({opacity: 0})),
// Transition between all states except for immediate transitions
transition('* => asc, * => desc, * => active, * => hint', animate('0ms')),
transition('* <=> *', animate(SORT_ANIMATION_TRANSITION))
transition('* => asc, * => desc, * => active, * => hint, * => void', animate('0ms')),
transition('* <=> *', animate(SORT_ANIMATION_TRANSITION)),
]),

/**
Expand Down
4 changes: 4 additions & 0 deletions src/lib/sort/sort-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ $mat-sort-header-arrow-hint-opacity: 0.38;
position: relative;
display: flex;

// Start off at 0 since the arrow may become visible while parent are animating.
// This will be overwritten when the arrow animations kick in. See #11819.
opacity: 0;

&,
[dir='rtl'] .mat-sort-header-position-before & {
margin: 0 0 0 $mat-sort-header-arrow-margin;
Expand Down