-
Notifications
You must be signed in to change notification settings - Fork 396
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
How to get the component contents within Javascript when the sub-components are dynamically created? #3409
Comments
Note that if we don't use <radio-buttons on-select="radioSelected">
{{#each myArray}}
<radio-button text="{{.}}">{{.}}</radio-button>
{{/each}}
</radio-buttons> So the problem is that we can't get the "content" of a component when it's created by a loop. |
Since
I suppose you could also combine those in something like this. |
Description:
I've my reasons to re-invent the radio buttons with
<button>
elements (like displaying "loading" icon and confirming database writes before displaying a "selected" tick). This is the stripped down version of myradio-buttons
component (playground):However, when I try to create the
radio-button
s with an{{#each}}
loop, buttons'on-click
handler doesn't work as intended: playground:Expected output when we click on
[a]
button:selection is: a
Observed output is:
selection is: undefined
How can I make it work when I create the sub-components dynamically? What becomes different when we encapsulate the sub-components into the
{{#each}}
loop?Versions affected:
1.4
Platforms affected:
Browser
The text was updated successfully, but these errors were encountered: