Material: mdAutocomplete: Modifies body position

Created on 15 Aug 2015  路  4Comments  路  Source: angular/material

I'm not sure if this is intended behavior or not, but some of the time when I type in an md-autocomplete box, the element style of the body tag is changed which makes my navbar disappear. The negative top value varies, and I'm not sure how to avoid it.

The navbar is the gray in the first picture with the teal bottom border part (I blocked out most of the content)

Before:

before

Enter in the md-autocomplete:

category

After:

after

Suggestions block and style:

suggestion-block-style

I'm guessing that the since the <body> is the parent of the <ul> containing the suggestions that it adjusts based on that. Is there a reason the suggestions have to be on the top level?

I was thinking the suggestions <ul> could be injected into the element where the <md-autocomplete> is instead of the top level. This might make it easier to format the position of the list as well?

/*!

Most helpful comment

Similar to my comment on #6188
+1

I commented out the first applyStyles in the disableBodyScroll function and that seemed to fix this problem for me:
https://github.com/angular/material/blob/d963dca9f63d5865c02a0ff9e3a3bd1292b71460/src/core/util/util.js#L209

All 4 comments

Seems similar to #4151

Similar to my comment on #6188
+1

I commented out the first applyStyles in the disableBodyScroll function and that seemed to fix this problem for me:
https://github.com/angular/material/blob/d963dca9f63d5865c02a0ff9e3a3bd1292b71460/src/core/util/util.js#L209

+1

This issue is closed as part of our deprecation effort.
For details, see our post Spring Cleaning 2016.

Was this page helpful?
0 / 5 - 0 ratings