Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Conversation

@maxisam
Copy link

@maxisam maxisam commented Nov 17, 2014

for this change

@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

for this change

@amir20
Copy link

amir20 commented Nov 17, 2014

Should it be .css('bottom', 0) instead?

@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

I think this way is to fix modal backdrop overlaying the modal's scrollbar.

more information twbs/bootstrap#14916

@amir20
Copy link

amir20 commented Nov 17, 2014

Bootstrap removed bottom: 0 in the css. So I thought that would be a safer fix.

@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

I think I did it just like what BT3.3.1 did in their modal js. I believe it is the way to fix the issue in certain environment.

@mtraynham
Copy link

bottom: 0 seems to work for me.
Example (Angular 1.3.2, Bootstrap 3.3.1, Angular-Bootstrap 0.12.0):
http://jsfiddle.net/vczoLtb6/

But, it looks like it was changed because of the scrollbar:
twbs/bootstrap#14916

Although, when I try to reproduce that issue with Angular-Bootstrap, it seems to be ok:
http://jsfiddle.net/vczoLtb6/1/

When I tried this solution with .css, I was getting an element has no property named css exception, not sure if that was an issue with jQLite...

@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

@mtraynham what do you mean by "you got an element has no property named css exception" ?

with my pull request ?

@mtraynham
Copy link

@maxisam My fault, the error was Cannot read property 'css' of undefined. My guess is attr returned a null value. I pulled in your patch, along with the Angular 1.3 date patches here:

https://github.com/mtraynham/bootstrap/blob/6db27897b313387b37d82ff93a17b3ee3ff0afec/dist/ui-bootstrap-tpls-0.12.0.js

Here's a fiddle:
http://jsfiddle.net/vczoLtb6/2/

@mtraynham
Copy link

After a quick debug, looks like modal.backdropClass was undefined at that point in the code. jQLite is trying to be smart about handling that and acting as a getter instead of a setter. So you get back the value of attribute backdrop-class instead of the background DOM element.

angularBackgroundDomEl.attr('backdrop-class', modal.backdropClass); 
// Returns value of attribute `backdrop-class`

Maybe move the css to it's own line:

angularBackgroundDomEl.css('height', body[0].scrollHeight);

Probably a timing issue if you ask me.

@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

@mtraynham You are correct. I guess because I used jQuery, so it works fine. And apparently jqLite works differently.

@maxisam maxisam closed this Nov 17, 2014
@maxisam
Copy link
Author

maxisam commented Nov 17, 2014

I closed this one and submit another pull request at #2984

Thanks @mtraynham for pointing out the issue

here is the demo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants