-
Notifications
You must be signed in to change notification settings - Fork 6.8k
perf(table): Slightly improve speed of adding/remvoing sticky styles #19823
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
Changes from all commits
3ce5641
6689847
7ba235f
315a37e
bad56ed
5721159
0c4f5c6
7977e23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
@use '../../material/core/style/vendor-prefixes'; | ||
@import '@material/data-table/mixins.import'; | ||
@import '../mdc-helpers/mdc-helpers'; | ||
|
||
@include mdc-data-table-core-styles($query: $mat-base-styles-without-animation-query); | ||
|
||
.mat-table-sticky { | ||
@include vendor-prefixes.position-sticky; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,7 @@ import {_DisposeViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY} from '@angular/cd | |
export class MatTable<T> extends CdkTable<T> { | ||
/** Overrides the sticky CSS class set by the `CdkTable`. */ | ||
protected stickyCssClass = 'mat-table-sticky'; | ||
|
||
/** Overrides the need to add position: sticky on every sticky cell element in `CdkTable`. */ | ||
protected needsPositionStickyOnElement = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andrewseguin is there any reason we couldn't just always use a css class for this instead of attaching styles directly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm up for making that change now, though I fear it could be breaking for any projects that have subclassed CdkTable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it feels to me like an internal implementation detail, but I'm curious to get @andrewseguin's take There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there's a reason - we should have a follow up PR that attempts to switch to just the class |
||
} |
Uh oh!
There was an error while loading. Please reload this page.