You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a selector like this is really needed, it's possible to do it in a simpler way like:
findOne(node,'.three .two');
I think the rationale for the scope option was to support finder signatures without a string selector argument, like
findOne(node,{scope: '.three .two'});
However, as shown above, in its 3-argument form it looks broken.
Implementation plan
In order to support the 2-argument signature with options, let's implement the new option called selector.
This would be only allowed in the 2-argument signature form:
findOne(node,{selector: '.two'});// => `.one .two`// together with the `scope` the works exactly like it works todayfindOne(node,{selector: '.two',scope: '.three'});// => `.one .three .two`// WRONG: passing 2 selectors should not be possiblefindOne(node,'.two',{selector: '.boom'});// => Throw!
Then we can deprecate the scope, and remove it at some point.
The text was updated successfully, but these errors were encountered:
Cause it seems to behave in a counter-intuitive way.
A query like:
generates a selector like
.one .three .two
.If a selector like this is really needed, it's possible to do it in a simpler way like:
I think the rationale for the
scope
option was to support finder signatures without a string selector argument, likeHowever, as shown above, in its 3-argument form it looks broken.
Implementation plan
In order to support the 2-argument signature with options, let's implement the new option called
selector
.This would be only allowed in the 2-argument signature form:
Then we can deprecate the
scope
, and remove it at some point.The text was updated successfully, but these errors were encountered: