However this may be counter-intuitive if a user attempts to call finder methods like css or css_at on a NodeSet as then the return value will simply be the original set rather than aggregation of selections over each node in the set, as may be expected due to familiarity with popular js libraries like jquery.
I would suggest defining finder methods for NodeSet which aggregate the result of running the corresponding methods on each item in set.
I can work on a fix if there is consensus regarding changing this behavior.
I see that in https://github.com/opal/opal-browser/blob/master/opal/browser/dom/node_set.rb#L17-L36 , methods applied to NodeSet are transparently applied to each dom node in set iteratively, with the return value always being the original set.
However this may be counter-intuitive if a user attempts to call finder methods like
css
orcss_at
on a NodeSet as then the return value will simply be the original set rather than aggregation of selections over each node in the set, as may be expected due to familiarity with popular js libraries like jquery.I would suggest defining finder methods for NodeSet which aggregate the result of running the corresponding methods on each item in set.
I can work on a fix if there is consensus regarding changing this behavior.