Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

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

Merged
merged 2 commits into from
Apr 3, 2013
Merged

Conversation

jhogervorst
Copy link
Contributor

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.

…tinput: height not correctly calculated due to box-sizing
@jaspermdegroot
Copy link
Contributor

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?

@jhogervorst
Copy link
Contributor Author

@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!

@jaspermdegroot
Copy link
Contributor

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

As requested in PR #5848.
jaspermdegroot added a commit that referenced this pull request Apr 3, 2013
Textinput: height correctly calculated (without extra padding) for box-sizing
@jaspermdegroot jaspermdegroot merged commit 0a8d34d into jquery-archive:master Apr 3, 2013
@jhogervorst jhogervorst deleted the issue-5690 branch April 3, 2013 16:41
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.

Textinput: height not correctly calculated due to box-sizing
2 participants