8000 Core: Remove support for jQuery 4.x by mgol · Pull Request #554 · jquery/jquery-migrate · GitHub
[go: up one dir, main page]

Skip to content

Core: Remove support for jQuery 4.x #554

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

Merged
merged 11 commits into from
Feb 18, 2025
Prev Previous commit
Next Next commit
Attributes: Update warnings.md to not mention jQuery 4.0
  • Loading branch information
mgol committed Feb 2, 2025
commit 75c35bcc2ec27d52a354026d1c7722acad36c7c9
4 changes: 2 additions & 2 deletions warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ This is _not_ a warning, but a console log message the plugin shows when it firs
### \[boolean-attributes\] JQMIGRATE: Boolean attribute 'NAME' value is different from its lowercased name
### \[boolean-attributes\] JQMIGRATE: Boolean attribute 'NAME' value is not set to its lowercased name

**Cause**: Prior to jQuery 4.0, when calling `.attr( name, value )` with any non-`false` non-`null` `value`, jQuery would actually set it to `name`. Similarly, regardless of the actual value, `.attr( name )` used to return `name` lowercased. jQuery 4.0 removes this special behavior.
**Cause**: When calling `.attr( name, value )` with any non-`false` non-`null` `value`, jQuery would actually set it to `name`. Similarly, regardless of the actual value, `.attr( name )` used to return `name` lowercased. This behavior is deprecated.

**Solution**: Always set boolean attributes to their names, whether when using jQuery (`.attr( name, name )`), native APIs (`.setAttribute( name, name )`) or directly in HTML (`<input checked="checked">`).

### \[attr-false\] JQMIGRATE: Setting the non-ARIA non-boolean attribute 'NAME' to false

**Cause**: Prior to jQuery 4.0, calling `.attr( name, false )` was only removing the attribute when `name` was a boolean attribute; otherwise, it was setting the attribute value to `"false"`. In jQuery 4.x, it will remove any non-ARIA attribute.
**Cause**: Calling `.attr( name, false )` only removes the attribute when `name` is a boolean attribute; otherwise, it sets the attribute value to `"false"`. This behavior is deprecated for non-ARIA attributes.

**Solution**: If you want to set the value of an attribute to `"false"`, wrap it in quotes: `.attr( name, "false" )`.

Expand Down
0