fix(menu): improve menu open animation #5908
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current open animation behavior for the menus does not look like to follow the Material spec, and it's not elegant. (Material.io video demo).
The menu seems to be somehow broken with the first look, because first you will get an empty (transparent) container which has shadow border, then the content appears inside the container.
You will see slow motion demos in bellow:
The current behavior of the menu open animation:
The new open animation behavior (after the change):
Side by side view:
What Changed?
The menu container did not have any background color, and instead of that the content of the menu (
mat-menu-content
) had a white background color, and as far as I know, we don't have any rules in the Material spec that the menu should be transparent until its content appeared.There is also no need to set the background color for the content of the menu since by this change, we will see just the parent background color.
Other Material Design Menus
Material Design Lite
AngularJS Material
Material guidelines demos