Skip to content

fix(material-experimental/mdc-table): add background color; disable hover styles; fix sticky columns #22723

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 3 commits into from
May 19, 2021

Conversation

andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented May 19, 2021

The MDC-based table does not handle sticky columns. Cells overlap their text since they do not have a background color. Fixed by adding a background color to the table like we do with the legacy table, and inheriting the background down through the component.

Hover styles have been disabled. They break this fix since they include opacity, introducing the same issue. MDC should change their default hover color to be a solid color rather than one with an alpha channel.

@andrewseguin andrewseguin added the P2 The issue is important to a large percentage of users, with a workaround label May 19, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 19, 2021
@andrewseguin andrewseguin added the target: patch This PR is targeted for the next patch release label May 19, 2021
// (already set in MDC), and cell.
.mat-mdc-table tbody, .mat-mdc-table tfoot,
.mat-mdc-cell, .mat-mdc-footer-cell {
background: inherit;
Copy link
Member

Choose a reason for hiding this comment

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

Instead of having these inherit the background, would it make sense to just assign the background to the cells in the theme? This feels like something that we could forget about if we remove the background from the theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean assign the card background to the cells? The benefit with the inherit approach is that users can style the table host element with a background and it works as expected, rather than identifying that they need to style the cell background.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, makes sense. Let's keep it like this.

Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

Choose a reason for hiding this comment

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

lgtm

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label May 19, 2021
@andrewseguin andrewseguin merged commit 0611a0d into angular:master May 19, 2021
andrewseguin added a commit that referenced this pull request May 19, 2021
…over styles; fix sticky columns (#22723)

* fix(material-experimental/mdc-table): add background color; disable hover styles; fix sticky columns

* fix(material-experimental/mdc-table): lint

* fix(material-experimental/mdc-table): extra line

(cherry picked from commit 0611a0d)
@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 Jun 19, 2021
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 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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants