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(material/menu): position classes not updated when window is resized #24385

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 9, 2022

Relates to internal bug b/218602349. We were calling MatMenu.setPositionClasses in order to set the classes if the position changes, but the call was outside of the NgZone so nothing was happening. These changes bring the call back into the NgZone.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels Feb 9, 2022
@crisbeto crisbeto requested a review from a team as a code owner February 9, 2022 10:14
Relates to internal bug b/218602349. We were calling `MatMenu.setPositionClasses` in order to set the classes if the position changes, but the call was outside of the `NgZone` so nothing was happening. These changes bring the call back into the `NgZone`.
@crisbeto crisbeto changed the title fix(material/menu): position classes not update when window is resized fix(material/menu): position classes not updated when window is resized Feb 10, 2022
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM, just one question

src/material-experimental/mdc-menu/menu.ts Show resolved Hide resolved
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 10, 2022
@wagnermaciel wagnermaciel merged commit f868e33 into angular:master Feb 14, 2022
wagnermaciel pushed a commit that referenced this pull request Feb 14, 2022
#24385)

Relates to internal bug b/218602349. We were calling `MatMenu.setPositionClasses` in order to set the classes if the position changes, but the call was outside of the `NgZone` so nothing was happening. These changes bring the call back into the `NgZone`.

(cherry picked from commit f868e33)
@@ -1326,6 +1326,29 @@ describe('MatMenu', () => {
expect(panel.classList).not.toContain('mat-menu-above');
}));

it('should update the position classes if the window is resized', fakeAsync(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@crisbeto This test does somehow not cover the new logic as it passes even without the changes in code.

amysorto pushed a commit to amysorto/components that referenced this pull request Feb 15, 2022
angular#24385)

Relates to internal bug b/218602349. We were calling `MatMenu.setPositionClasses` in order to set the classes if the position changes, but the call was outside of the `NgZone` so nothing was happening. These changes bring the call back into the `NgZone`.
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Feb 18, 2022
This PR contains the following updates:

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

---

### Release Notes

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

### [`v13.2.3`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#&#8203;1323-platinum-pen-2022-02-16)

[Compare Source](angular/components@13.2.2...13.2.3)

##### material

| Commit | Type | Description |
| -- | -- | -- |
| [2c73b2df6](angular/components@2c73b2d) | fix | **menu:** position classes not update when window is resized ([#&#8203;24385](angular/components#24385)) |

##### cdk-experimental

| Commit | Type | Description |
| -- | -- | -- |
| [8c632ee87](angular/components@8c632ee) | fix | **column-resize:** Fix bug in hover logic introduced by IE cleanup ([#&#8203;24396](angular/components#24396)) |

#### Special Thanks

Karl Seamon, Kristiyan Kostadinov, Paul Gschwendtner, Zach Arend and Zack Elliott

<!-- CHANGELOG SPLIT MARKER -->

</details>

---

### Configuration

📅 **Schedule**: 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).

Co-authored-by: cabr2-bot <[email protected]>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1176
Reviewed-by: Epsilon_02 <[email protected]>
Co-authored-by: Calciumdibromid Bot <[email protected]>
Co-committed-by: Calciumdibromid Bot <[email protected]>
@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 Mar 18, 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 G This is is related to a Google internal issue 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants