-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngShow/ngHide breaks css layout - ng-hide-remove overrides css display. #8485
Comments
@matsko is this a "works as intended" scenario? I'm sure there's a workaround for this but I can't think in CSS right now :( |
@Thinkscape this is fixed in 1.3: 1d90744, but the fix can't work with 1.2 since we're supporting IE8 in the older 1.2 version (IE8 doesn't have the If you're happy to use 1.3 then upgrade to that. Otherwise If you don't want to update to 1.3, but you're happy with the CSS code in 1.3's configuration then place the same CSS code at the top of your index.html file in your application (or inside your website's stylesheet code). You can also target IE8 in a different way and provide different CSS code for it. Regarding 1.2, there's nothing we can do for it at the moment. |
@matsko thanks, makes sense. tl;dr With Angular 1.2, add the following to your css - it'll fix the bug, but will break IE8 (no change needed for 1.3 though). .ng-hide-add-active, .ng-hide-remove {
display: inherit !important;
}
.ng-hide:not(.ng-animate) {
display: none !important;
} |
You may also want to place styles to negate the styles present in the 1.2 code: .ng-hide-add-active, .ng-hide-remove {
display: inherit !important;
}
.ng-hide:not(.ng-animate) {
display: none !important;
} |
thx. I'll try to test it today. |
When using
ng-show
orng-hide
, recent versions of angular (after 1.2.12) are now addingng-hide-remove ng-hide-remove-active
and similar classes.In CSS we read:
After upgrading to 1.2.21 this directive started to break my app's layout, because some elements use
display: inline-block
,display: table-cell
etc. which gets overridden after showing the element.Workaround:
With Angular 1.2, add the following to your css - it'll fix the bug, but will break IE8 (no change needed for 1.3 though) (Thanks @matsko )
The text was updated successfully, but these errors were encountered: