Opened 10 years ago

Closed 10 years ago

#9053 closed bug (duplicate)

:data selector fails when value is falsy

Reported by: linus.yan87 Owned by:
Priority: minor Milestone: none
Component: ui.core Version: 1.8.20
Keywords: Cc:
Blocked by: Blocking:

Description

We can use .data(key, value) to save 0 and null on element. But we can't get the element with :data selector. Because for 0 and null, !!data(ele, key) is !!0 and !!null, and they both return false. So it failed to get the elements.

Change History (3)

comment:1 Changed 10 years ago by tj.vantoll

Status: newopen
Summary: :data selector failed when value is 0 or null:data selector fails when value is falsy

comment:2 Changed 10 years ago by Scott González

I'm inclined not to change this and instead deprecate :data when #9030 lands.

comment:3 Changed 10 years ago by Scott González

Resolution: duplicate
Status: openclosed

Duplicate of #5403.

Note: See TracTickets for help on using tickets.