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

feat(material/menu): allow updating menu position a la autocomplete #22046

Merged

Conversation

@terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Feb 26, 2021

On document changes the menu may not be located in the correct location anymore. This exposes the OverlayRef's updatePosition on the trigger so a user can call it without relying on the private variable _overlayRef.

@terencehonles terencehonles requested a review from crisbeto as a code owner Feb 26, 2021
@google-cla google-cla bot added the cla: yes label Feb 26, 2021
Copy link
Member

@crisbeto crisbeto left a comment

The changes look good, but the CI is failing because:

  1. The API golden needs to be updated by running yarn approve-api menu.
  2. The MDC test lint check is failing, because you have to add the same test to src/material-experimental/menu/menu.spec.ts.
*/
updatePosition(): void {
if (this._overlayRef) {
this._overlayRef.updatePosition();

This comment has been minimized.

@crisbeto

crisbeto Mar 14, 2021
Member

nit: can be reduce to this._overlayRef?.updatePosition().

This comment has been minimized.

@terencehonles

terencehonles Mar 15, 2021
Author Contributor

👍 wasn't sure which was preferred here.

@terencehonles terencehonles force-pushed the terencehonles:allow-updating-menu-position branch from 336e038 to a03b5c5 Mar 15, 2021
@terencehonles
Copy link
Contributor Author

@terencehonles terencehonles commented Mar 15, 2021

Thanks, I was expecting I'd have time to update the PR earlier, but I'll probably tied up for a bit if that doesn't handle everything.

@terencehonles terencehonles force-pushed the terencehonles:allow-updating-menu-position branch from a03b5c5 to 4dff505 Mar 22, 2021
@terencehonles terencehonles force-pushed the terencehonles:allow-updating-menu-position branch from 4dff505 to e95cac6 Mar 22, 2021
Copy link
Member

@crisbeto crisbeto left a comment

LGTM

@andrewseguin andrewseguin merged commit ad24865 into angular:master Mar 23, 2021
16 checks passed
16 checks passed
@in-solidarity
Inclusive Language Check completed with success
Details
@ngbot
ci/angular: merge status All checks passed!
ci/circleci: api_golden_checks Your tests passed on CircleCI!
Details
ci/circleci: bazel_build Your tests passed on CircleCI!
Details
ci/circleci: build_release_packages Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests Your tests passed on CircleCI!
Details
ci/circleci: integration_tests Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: ngcc_compatibility Your tests passed on CircleCI!
Details
ci/circleci: tests_browserstack Your tests passed on CircleCI!
Details
ci/circleci: tests_local_browsers Your tests passed on CircleCI!
Details
ci/circleci: tests_saucelabs Your tests passed on CircleCI!
Details
ci/circleci: upload_release_packages Your tests passed on CircleCI!
Details
ci/circleci: view_engine_build Your tests passed on CircleCI!
Details
ci/circleci: view_engine_test Your tests passed on CircleCI!
Details
@google-cla
cla/google All necessary CLAs are signed
@terencehonles terencehonles deleted the terencehonles:allow-updating-menu-position branch Mar 23, 2021
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Apr 23, 2021

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 Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants