#13658 closed defect (fixed)
dojo.query $= returns incorrect elements
Reported by: | CraigMorgan | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.7.5 |
Component: | Query | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
This bug is occuring for me in IE9, but I believe it will be reproducible in all browsers without QSA (querySelectorAll) functionality available.
Example
In case the above link fails, here's the example:
javascript:
//dojo.require("dojo.query"); dojo.ready(function() { var nodeList = dojo.query("div[id$='55555']", dojo.byId('other')); nodeList .forEach(function(node) { console.log("result: ", node.outerHTML); }); console.log("nodeList: ", nodeList); });
html:
<div id='other'> <div id='abc55555'></div> <div id='abd55555efg'></div> <div id='55555abc'</div> <div id='1'></div> <div id='2c'></div> <div id='3ch'></div> <div id='4chr'></div> <div id='5char'></div> <div id='6chars'></div> </div>
The above example should only output <div id='abc55555'></div>
to console. Instead, it also outputs <div id='3ch'></div>
.
The bug is in the line "return (ea.lastIndexOf(value)==(ea.length-value.length));", which can be found on line 452 of query.js .
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | General → Query |
---|---|
Owner: | set to Kris Zyp |
Summary: | dojo.query '$=' → dojo.query $= returns incorrect elements |
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|
comment:7 Changed 10 years ago by
Milestone: | 1.8 → 1.7.5 |
---|
Note: See
TracTickets for help on using
tickets.
Sorry about the summary, I forgot to finish it. It should be something like "dojo.query $= returns incorrect elements", but I can't see how to change it now.