Skip to content
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

perf(table): Slightly improve speed of adding/remvoing sticky styles #19823

Merged
merged 8 commits into from Aug 6, 2020

Conversation

kseamon
Copy link
Collaborator

@kseamon kseamon commented Jul 1, 2020

In the longer run, it'd be nice to remove the addition of inline styles entirely (and have some simple CSS attached to CdkTable).

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 1, 2020
src/cdk/table/sticky-styler.ts Outdated Show resolved Hide resolved
src/cdk/table/sticky-styler.ts Show resolved Hide resolved
src/cdk/table/sticky-styler.ts Show resolved Hide resolved
@@ -32,4 +32,7 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
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;
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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

@jelbourn jelbourn added G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels Jul 2, 2020
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I definitely want to try just making this the only behavior in a follow-up; if it passes TGP when I wouldn't consider it a breaking change

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker P2 The issue is important to a large percentage of users, with a workaround labels Jul 10, 2020
@jelbourn
Copy link
Member

@kseamon can you rebase this PR?

@mmalerba mmalerba removed the lgtm label Jul 31, 2020
@jelbourn jelbourn added this to PRs in P2 PRs Aug 4, 2020
@mmalerba mmalerba merged commit 1b1c31e into angular:master Aug 6, 2020
P2 PRs automation moved this from PRs to Done Aug 6, 2020
mmalerba pushed a commit that referenced this pull request Aug 6, 2020
…19823)

* perf(table): Slightly improve speed of adding/remvoing sticky styles

* fix scss

* Fix

* tests fixed

* approve api

* comments

* build

* lint

(cherry picked from commit 1b1c31e)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
P2 PRs
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants