-
Notifications
You must be signed in to change notification settings - Fork 476
Warn about jQuery.cssNumber #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fixed in aee3d06 |
@dmethvin Where did that commit land? I don't see it on |
Darned good question! I can't see it either. I'll reopen this to get it into master. |
An upcoming release of Migrate will generate warnings for calls to .css() that pass numbers rather than strings, see jquery/jquery-migrate#296 . At the moment, core's .offset() setter passes numbers rather than px strings so it would throw warnings. This commit fixes that. Closes gh-4508
This can't be landed until internal |
@dmethvin Oh, I see, the linked commit won't work for jQuery 3.x. That said, it seems we could do something else & detect & warn against pushes to |
Hmmm, sure, we could use a |
Hmm, now that I think about it, pushes to Is the issue that Core itself uses numbers as values somewhere? Can you share more details? |
Hmm, looking closer at the commit removing |
An upcoming release of Migrate will generate warnings for calls to `.css()` that pass numbers rather than strings, see jquery/jquery-migrate#296. At the moment, core's `.offset()` setter passes numbers rather than px strings so it would throw warnings. This commit fixes that. Ref jquerygh-4508 Co-authored-by: Dave Methvin <dave.methvin@gmail.com>
An upcoming release of Migrate will generate warnings for calls to `.css()` that pass numbers rather than strings, see jquery/jquery-migrate#296. At the moment, core's `.offset()` setter passes numbers rather than px strings so it would throw warnings. This commit fixes that. Fixes jquerygh-4525 Ref jquerygh-4508 Co-authored-by: Dave Methvin <dave.methvin@gmail.com>
@dmethvin I think your PR might work with minor modifications. I submitted jquery/jquery#4651 so that it also works with Core |
See jquery/jquery#4009
Detect assignments to
jQuery.cssNumber
and recommend that it only be done if that property exists; note that it's going away in 4.0.Recommend that people do not pass raw numbers to
.css()
and instead always pass strings and append"px"
when appropriate. Point outline-height
as a troublesome case.The text was updated successfully, but these errors were encountered: