Textinput: height correctly calculated (without extra padding) for box-sizing #5848

merged 2 commits into from Apr 3, 2013

2 participants


Fixes #5690. As I explained there, scrollHeight contains the padding of the element as well, while the height passed to .height() should only be of the content. Because of that we subtract the padding height.

@jhogervorst jhogervorst Textinput: calculated height without extra padding. Fixed #5690 - Tex…
…tinput: height not correctly calculated due to box-sizing
jQuery Foundation member

hi @jhogervorst

Thanks for the new PR!
.css() returns 0 if no padding has been set so it seems safe to remove the || 0. Or did you find cases where it results in an empty string or NaN?


@uGoMobi You're right, the || 0 is not necessary. I searched through the source code to see how this was done in other places. It turned out that I looked at the jQuery source instead of the jQuery Mobile source. I will change this – you should see the changes in this pull request later today. Thanks for your feedback!

jQuery Foundation member

@jhogervorst - Ok, great! I will merge after your commit.

@jhogervorst jhogervorst Removed unnecessary code
As requested in PR #5848.
@jaspermdegroot jaspermdegroot merged commit 0a8d34d into jquery:master Apr 3, 2013
@jhogervorst jhogervorst deleted the unknown repository branch Apr 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment