#7770 closed bug (duplicate)
$('[attr]') returns nothing if attr is present but has no value in IE
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | 1.next |
Component: | selector | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | #5637 | Blocking: |
Description
<table data-foo data-bar='bat'>
<tr>
<td id='test'></td>
</tr>
</table>
console.log($('[data-foo]')); console.log($('#test').parents('[data-foo]')); console.log($('#test').parents('[data-bar]'));
returns
[<table>...] [] [<table>...]
Change History (12)
comment:1 Changed 12 years ago by
Blocked by: | 5637 added |
---|---|
Component: | unfiled → selector |
Priority: | undecided → high |
Status: | new → open |
comment:3 Changed 12 years ago by
This is a duplicate of http://bugs.jquery.com/ticket/7369 and has been fixed in the recent changes to sizzle.
comment:4 Changed 12 years ago by
I'm not sure this is a dupe of that bug, and my regression tests still fail in the most recent version of Sizzle.
Also, it looks like the Sizzle repo just moved so my pull request is now here: https://github.com/jquery/sizzle/pull/54
comment:6 Changed 12 years ago by
I closed [pull 288](https://github.com/jquery/jquery/pull/288) from murz to clear out clutter but please include them in the patch if they are useful.
comment:7 Changed 12 years ago by
Milestone: | 1.6 → 1.next |
---|
comment:8 Changed 12 years ago by
Summary: | parents('[attr]') returns nothing if attr is present but has no value → $('[attr]') returns nothing if attr is present but has no value |
---|
comment:9 Changed 12 years ago by
Summary: | $('[attr]') returns nothing if attr is present but has no value → $('[attr]') returns nothing if attr is present but has no value in IE |
---|
A selector with an attribute with no value seems to be the heart of multiple selector bugs.
comment:11 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
I think this is actually a bug with Sizzle.matches, see my pull request here: https://github.com/jeresig/sizzle/pull/54
I also opened a pull request with some regression tests for jQuery: https://github.com/jquery/jquery/pull/288