f0062f5cbe
This exposes an api for <ToggleButton /> so you can call it from elsewhere, specifically here we use the api.click to close the dropdown menus which is required is the DOM containing the toggle button isn't redrawn as is the case with external links in a dropdown menu
13 lines
304 B
Handlebars
13 lines
304 B
Handlebars
<input
|
|
...attributes
|
|
{{ref this "input"}}
|
|
type="checkbox"
|
|
checked={{if checked 'checked' undefined}}
|
|
id={{concat 'toggle-button-' guid}}
|
|
onchange={{action 'change'}}
|
|
/>
|
|
<label {{ref this "label"}} for={{concat 'toggle-button-' guid}}>
|
|
{{yield (hash
|
|
click=(action 'click')
|
|
)}}
|
|
</label> |