Skip to content

jQuery 4 warning: Number-typed values are deprecated for jQuery.fn.css ("z-index", value)#1960

Closed
nagyimre1980 wants to merge 1 commit into
jquery:mainfrom
nagyimre1980:main
Closed

jQuery 4 warning: Number-typed values are deprecated for jQuery.fn.css ("z-index", value)#1960
nagyimre1980 wants to merge 1 commit into
jquery:mainfrom
nagyimre1980:main

Conversation

@nagyimre1980
Copy link
Copy Markdown

jquery-migrate-3.3.2.js: 100 JQMIGRATE: Number-typed values are deprecated for jQuery.fn.css ("z-index", value)

jquery-migrate-3.3.2.js: 100 JQMIGRATE: Number-typed values are deprecated for jQuery.fn.css ("z-index", value)
Copy link
Copy Markdown
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I made all Migrate warnings disappear when tested against the latest jQuery & jQuery Migrate versions but I haven't checked with the development jQuery version which is when this warning appears.

That said, I think it's a bug in Migrate. The intention was to not warn against CSS properties on which auto-suffixing was already not happening. We'll need another check in Migrate for this, I think.

@mgol mgol closed this Jul 6, 2021
@mgol mgol reopened this Jul 7, 2021
@mgol mgol changed the title Number-typed values are deprecated for jQuery.fn.css ("z-index", value) jQuery 4 warning: Number-typed values are deprecated for jQuery.fn.css ("z-index", value) Jul 7, 2021
@mgol mgol closed this Jul 7, 2021
@mgol
Copy link
Copy Markdown
Member

mgol commented Jul 7, 2021

Migrated to jquery/jquery-migrate#438.

mgol added a commit to jquery/jquery-migrate that referenced this pull request Jul 9, 2021
When used against jQuery Git (future jQuery 4), there were warnings when
`.css()` was used against `z-index` with a number value. This didn't make sense
as `z-index` never had `px` auto-appended. Commit
d25ecd6 was supposed to solve a similar problem
but it only worked fine for `3.x`.

To make the warning not show up when used with jQuery >=4 we need to fill in
`jQuery.cssNumber` with the latest version from jQuery 3.x so that the same
properties are allowed to have number values used with `.css()`.

Fixes gh-438
Closes gh-439
Ref jquery/jquery-ui#1960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants