Skip to content
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

$(el).data() calls break due to camelCase conversion #436

Open
liady opened this issue Jun 24, 2021 · 0 comments
Open

$(el).data() calls break due to camelCase conversion #436

liady opened this issue Jun 24, 2021 · 0 comments
Milestone

Comments

@liady
Copy link

liady commented Jun 24, 2021

Currently this migration script fixes only $.data() calls, but $.fn.data still have the incompatibility with automatic camelCase conversion.

// el: <div data-my-prop=test />
var data = $(el).data();
// data: {myProp: 'test'}
assert(data['my-prop']===test) // works on jQuery v2, fails on v3
liady added a commit to liady/jquery-migrate that referenced this issue Jun 24, 2021
When calling `$(el).data()`, the received object contains camel-cased keys, this fixes issue jquery#436
@mgol mgol added this to the 3.3.3 milestone Dec 2, 2021
@mgol mgol modified the milestones: 3.4.1, 3.5.0 Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants