jquery-migrate icon indicating copy to clipboard operation
jquery-migrate copied to clipboard

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

Open liady opened this issue 4 years ago • 0 comments

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 avatar Jun 24 '21 17:06 liady