mirror of
https://github.com/MontFerret/ferret.git
synced 2025-05-13 22:16:36 +02:00
fixed bug where ExistsBySelector() would look at element's parents instead of children.
This commit is contained in:
parent
24f6329203
commit
69f851a002
@ -468,9 +468,9 @@ func (el *HTMLElement) CountBySelector(_ context.Context, selector values.String
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (el *HTMLElement) ExistsBySelector(_ context.Context, selector values.String) (values.Boolean, error) {
|
func (el *HTMLElement) ExistsBySelector(_ context.Context, selector values.String) (values.Boolean, error) {
|
||||||
selection := el.selection.Closest(selector.String())
|
selection := el.selection.Find(selector.String())
|
||||||
|
|
||||||
if selection == nil || selection.Length() == 0 {
|
if selection.Length() == 0 {
|
||||||
return values.False, nil
|
return values.False, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user