Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing issues can lead to weird suggestions #463

Open
forki opened this issue Dec 1, 2018 · 5 comments
Open

Timing issues can lead to weird suggestions #463

forki opened this issue Dec 1, 2018 · 5 comments

Comments

@forki
Copy link
Contributor

forki commented Dec 1, 2018

image

I think if we find a suggestion that matches - we should just take it ;-)

@forki
Copy link
Contributor Author

forki commented Dec 1, 2018

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

@amirrajan
Copy link
Collaborator

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.

@forki
Copy link
Contributor Author

forki commented Dec 1, 2018 via email

@forki
Copy link
Contributor Author

forki commented Dec 1, 2018

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.

@lefthandedgoat
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants