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

Widgets in the top namespace should be visible to other widgets using #widget #76

Open
david opened this issue Sep 20, 2013 · 4 comments

Comments

@david
Copy link
Member

david commented Sep 20, 2013

They will be automatically scoped to the current widget

@adsteel
Copy link
Contributor

adsteel commented Dec 7, 2015

@david would that look something like this?

# in a role
widget ':top', '.top'
widget ':parent', '.parent', do
  widget :child, '.child'
end

# in a Cuke step
widget(:parent).widget(:child).widget(:top).classes #=> ['top']

@david
Copy link
Member Author

david commented Dec 7, 2015

I think it was something like

class Widget1 < Dill::Widget
end

class Widget2 < Dill::Widget
  widget :widget1, Dill::Widget1
end

But this should work, so I don't clearly remember why I added this.

@adsteel
Copy link
Contributor

adsteel commented Dec 7, 2015

I was working on implementing Capybara's drag_to, and I ran into a similar issue, maybe it had to do with that?

I wanted to implement:

widget :source, '.source'
widget :target, '.target'

widget(:source).drag_to(:target)

The issue I was running into was that because drag_to was a method on the source widget, and both were in the top namespace, I couldn't access the target widget from the source widget. Could that have something to do with it?

@david
Copy link
Member Author

david commented Dec 7, 2015

It's possible. I think we're resolving the constants with const_get, so maybe there's some setting that should be used to make it see more constants than it does now.

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

No branches or pull requests

2 participants