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

fix(expansion): fix expansion .mat-expansion-panel-header styles #20019

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

swseverance
Copy link
Contributor

@swseverance swseverance commented Jul 17, 2020

  • Add margin to .mat-content element to account for consumer using
    mat-expansion-panel components with the toggle hidden alongside
    mat-expansion-panel components where the toggle is visible
  • Adjust sizing of .mat-expansion-panel-header-title and
    .mat-expansion-panel-header-description elements so that the width
    of each respective element is uniform across multiple adjacent
    mat-expansion-panel elements
  • Fixes bug(expansion-panel): description not aligned when mixing rows with and without toggle #20002

LTR

image

RTL

image

Caretaker Note (andrewseguin, 2022-04): Breaks ~50 screenshot tests. Text in expansion panels are getting shifted over maybe 10 - 15px

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 17, 2020
@@ -45,12 +45,23 @@
flex: 1;
flex-direction: row;
overflow: hidden;

// width of .mat-expansion-indicator::after element
&:only-child {
Copy link
Member

Choose a reason for hiding this comment

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

This might break down if we add another element to the markup. Maybe we can set a class based on whether the toggle exists instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@crisbeto I've adopted this approach. I also realized that my original commit did not take into consideration togglePosition="before" being used. My new commit takes this into consideration.

image

crisbeto
crisbeto previously approved these changes Jul 17, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added lgtm action: merge The PR is ready for merge by the caretaker P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release P4 A relatively minor issue that is not relevant to core functions and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 17, 2020
@wagnermaciel
Copy link
Contributor

@swseverance This change breaks ~60 targets inside Google, mostly screenshot tests. I was taking a look at the diffs and they seem significant. I don't think it's worth the effort to fix the .mat-expansion-panel-header styles

@swseverance
Copy link
Contributor Author

@wagnermaciel ok. I’ll close the PR

@crisbeto
Copy link
Member

IMO this is still a worthwhile change. The screenshot diffs were expected since it moves an element a few pixels away in some cases.

@swseverance swseverance reopened this Jul 22, 2020
@wagnermaciel
Copy link
Contributor

I've been looking through the diffs for the screenshots and I'm going to try and see if I can come up with a fix for them and I'll let you know how it goes. From what I see we can ignore the vast majority of the changes and there are only maybe 1, 2, or 3 that I think someone would complain about

@wagnermaciel
Copy link
Contributor

This is generating some unexpected diffs inside of google. It'll be in our backlogs for things to debug but it's relatively low priority compared to other PRs

@mmalerba mmalerba removed the lgtm label Jul 31, 2020
@andrewseguin andrewseguin added needs rebase and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Dec 28, 2021
@andrewseguin
Copy link
Contributor

@swseverance I think we can try again to get this landed - would mind rebasing the rebase the PR?

@andrewseguin andrewseguin added the needs: clarification The issue does not contain enough information for the team to determine if it is a real bug label Mar 24, 2022
* Add margin to `.mat-content` element to account for consumer using
  `mat-expansion-panel` components with the toggle hidden alongside
  `mat-expansion-panel` components where the toggle is visible
* Adjust sizing of `.mat-expansion-panel-header-title` and
  `.mat-expansion-panel-header-description` elements so that the width
  of each respective element is uniform across multiple adjacent
  `mat-expansion-panel` elements
* Fixes angular#20002
@swseverance
Copy link
Contributor Author

@andrewseguin rebased!

@andrewseguin andrewseguin removed needs rebase needs: clarification The issue does not contain enough information for the team to determine if it is a real bug P4 A relatively minor issue that is not relevant to core functions labels Mar 25, 2022
@andrewseguin andrewseguin added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Apr 22, 2022
@andrewseguin andrewseguin self-assigned this Apr 22, 2022
@andrewseguin andrewseguin merged commit 2615b5f into angular:main Aug 15, 2022
andrewseguin pushed a commit that referenced this pull request Aug 15, 2022
…20019)

* Add margin to `.mat-content` element to account for consumer using
  `mat-expansion-panel` components with the toggle hidden alongside
  `mat-expansion-panel` components where the toggle is visible
* Adjust sizing of `.mat-expansion-panel-header-title` and
  `.mat-expansion-panel-header-description` elements so that the width
  of each respective element is uniform across multiple adjacent
  `mat-expansion-panel` elements
* Fixes #20002

(cherry picked from commit 2615b5f)
andrewseguin pushed a commit that referenced this pull request Aug 15, 2022
…20019)

* Add margin to `.mat-content` element to account for consumer using
  `mat-expansion-panel` components with the toggle hidden alongside
  `mat-expansion-panel` components where the toggle is visible
* Adjust sizing of `.mat-expansion-panel-header-title` and
  `.mat-expansion-panel-header-description` elements so that the width
  of each respective element is uniform across multiple adjacent
  `mat-expansion-panel` elements
* Fixes #20002

(cherry picked from commit 2615b5f)
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Aug 23, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@angular/cdk](https://github.com/angular/components) | dependencies | patch | [`14.1.2` -> `14.1.3`](https://renovatebot.com/diffs/npm/@angular%2fcdk/14.1.2/14.1.3) |
| [@angular/material](https://github.com/angular/components) | dependencies | patch | [`14.1.2` -> `14.1.3`](https://renovatebot.com/diffs/npm/@angular%2fmaterial/14.1.2/14.1.3) |

---

### Release Notes

<details>
<summary>angular/components</summary>

### [`v14.1.3`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#&#8203;1413-rubber-chicken-2022-08-19)

[Compare Source](angular/components@14.1.2...14.1.3)

##### cdk

| Commit | Type | Description |
| -- | -- | -- |
| [f661a9300e](angular/components@f661a93) | fix | **dialog:** fall back to node injector token doesn't exist in template injector ([#&#8203;25406](angular/components#25406)) |
| [b9f09aa741](angular/components@b9f09aa) | fix | **overlay:** backdropClass type mismatch ([#&#8203;25487](angular/components#25487)) |

##### material

| Commit | Type | Description |
| -- | -- | -- |
| [d1ef7e23c6](angular/components@d1ef7e2) | fix | **button-toggle:** toggle name falling out of sync if name changes ([#&#8203;24713](angular/components#24713)) |
| [19df7cf940](angular/components@19df7cf) | fix | **expansion:** fix lint issue ([#&#8203;25469](angular/components#25469)) |

##### expansion

| Commit | Type | Description |
| -- | -- | -- |
| [b1450b1cb5](angular/components@b1450b1) | fix | fix expansion `.mat-expansion-panel-header` styles ([#&#8203;20019](angular/components#20019)) |

#### Special Thanks

Andrew Seguin, Dmitrii Kuzmin, Kristiyan Kostadinov, ko-tori and swseverance

<!-- CHANGELOG SPLIT MARKER -->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjE2NS4xIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1515
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
@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 15, 2022
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 merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(expansion-panel): description not aligned when mixing rows with and without toggle
6 participants