Opened 12 years ago
Closed 12 years ago
#9665 closed defect (invalid)
NodeList - can't select mulitple children elements
Reported by: | Les | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Core | Version: | 1.3.2 |
Keywords: | NodeList.children | Cc: | |
Blocked By: | Blocking: |
Description
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/NodeList-manipulate.html
This code should return 7 elements, but it returns an empty array.
dojo.require("dojo.NodeList-traverse"); dojo.query('#inputForm').children('input,select')
This code however returns all 7 elements:
dojo.require("dojo.NodeList-traverse"); dojo.query('input,select')
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | General → Core |
---|---|
Milestone: | tbd → 1.4 |
Owner: | changed from anonymous to James Burke |
This happens because dojo._filterQueryResult is used underneath, and it is a very basic filter: just handles a simple selector that can be applied on one node without context.
I will look at switching all of those _filterQueryResult calls to just use dojo.query.
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is actually working as designed, there are no immediate children of #inputForm that are input or select elements, the immediate children are divs that contain the elements. dojo.query('#inputForm').query('input,select') works because it is not restricting itself to immediate children but considers all nested children.
There is still a deficiency with the selectors supported by children, but I will use #10029 to track that.
This also works fine (7 elements returned):