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

[MdSelect] Adjust position when body has margin #1551

Merged
merged 2 commits into from
Feb 28, 2018

Conversation

AlbertLucianto
Copy link
Contributor

This PR is a possible fix for issue #1206.

Description

This issue might be related to Popper.js library.

After render, popper instance which wraps MdMenuContent is mounted as a direct child of body, and changes in body's position affects where the popper is mounted.

By adjusting popperSettings.modifiers.offset with body's position relative to the viewport, the menu will be correctly positioned.

Screenshots

Style

body {
  margin-top: 100px;
  margin-left: 100px;
}

/* Or an element which can affect body's position */
#app {
  margin-top: 100px;
  margin-left: 100px;
}

Before

Menu is off position the size of the body's margin (or any elements pushing the bodys position).

screen shot 2018-02-24 at 7 18 25 pm

After

screen shot 2018-02-24 at 7 16 38 pm

Really appreciate for feedbacks and reviews.

@marcosmoura
Copy link
Member

Sounds good for me! Thank you so much!

@marcosmoura marcosmoura merged commit c820b72 into vuematerial:dev Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants