Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(modal): Fix calculation of top when % property
An absolute-positioned element with % "top" property that is hidden through "display: none;" does not evaluate to the same value as a visible one for the following JS: window.getComputedStyle(element).top The computed "top" value for the hidden element is still the % value, while it is the computed px value if the element is visible or when using "visibility: hidden;". This is demonstrated in the following Plunker: http://run.plnkr.co/preview/cjkut64np00072y6ccj3tmqem/ $modalStack.open expects the expression above to return the px value, so a "10%" value gets treated as "10px". This is not the desired behavior, and a big limitation now that people use a big range of screen sizes. The faux modal is temporarily inserted with "z-index: -1" (JS), "display: none" (CSS), and "visibility: hidden;" (CSS). As a workaround, this commit assigns "display: block" (JS) to the faux modal.
- Loading branch information