#14799 closed bug (notabug)
Data with hyphenated keys, set via plain object, becomes inaccessible via hyphenated key
Reported by: | Rick Waldron | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.11.0-rc1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
test(".data should not miss data-* w/ hyphenated property names #14047", function() { expect(2); var div = jQuery("<div>"); div.data({ "foo-bar": 1 }); div.data( "foo-bar", 2 ); equal( div.data( "foo-bar" ), 2, "data with property 'foo-bar' was correctly found"); equal( div.data( "fooBar" ), 2, "data with property 'fooBar' was correctly found"); });
This test fails the first assertion.
Change History (2)
comment:1 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
This can be fixed if jQuery updates both hyphenated and camel case keys
Note: See
TracTickets for help on using
tickets.
Intentional behaviour.