Open forki opened 5 years ago
ok scratch that. It's not because of timing.
let removeBtn = titleElement |> parent |> parent |> elementWithin "Remove"
so it finds the "Remove" but not within that other element
Are you allowed to put an explicit data attribute on the element? For example:
<button data-canopy-id="remove-button" />
That way you can find it directly without having to do any complex traversals.
The button is in a table. Every row has a remove element.
Am Sa., 1. Dez. 2018, 18:17 hat Amir Rajan notifications@github.com geschrieben:
Are you allowed to put an explicit data attribute on the element? For example:
That way you can find it directly without having to do any complex traversals.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lefthandedgoat/canopy/issues/463#issuecomment-443441736, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNE7Tfs47N_LTBKLe3ar9OOcvRzvjks5u0rmPgaJpZM4Y82cX .
Btw my test is working fine now. It was revealing a real bug. My point here is that elementWithin should not use suggestions for the whole page. It should only suggest actual sub elements.
I think that may be a one liner, I can try it out later.
https://github.com/lefthandedgoat/canopy/blob/master/src/canopy/canopy.parallell.functions.fs#L265
Change browser -> searchContext
I think if we find a suggestion that matches - we should just take it ;-)