I am trying to use Checkbox Alternate Lightning code as a code of CheckboxAlternate component
<aura:component >
<fieldset class="slds-form-element">
<legend class="slds-form-element__legend slds-form-element__label">Scheduled Day(s)</legend>
<div class="slds-form-element__control">
<div class="slds-checkbox--button-group">
<span class="slds-button slds-checkbox--button" for="monday">
<input type="checkbox" name="checkbox" id="monday" />
<label class="slds-checkbox--button__label" for="monday">
<span class="slds-checkbox--faux">Mon</span>
</label>
</span>
<span class="slds-button slds-checkbox--button" for="tuesday">
<input type="checkbox" name="checkbox" id="tuesday" />
<label class="slds-checkbox--button__label" for="tuesday">
<span class="slds-checkbox--faux">Tue</span>
</label>
</span>
<span class="slds-button slds-checkbox--button" for="wednesday">
<input type="checkbox" name="checkbox" id="wednesday" />
<label class="slds-checkbox--button__label" for="wednesday">
<span class="slds-checkbox--faux">Wed</span>
</label>
</span>
<span class="slds-button slds-checkbox--button" for="thursday">
<input type="checkbox" name="checkbox" id="thursday" />
<label class="slds-checkbox--button__label" for="thursday">
<span class="slds-checkbox--faux">Thu</span>
</label>
</span>
<span class="slds-button slds-checkbox--button" for="friday">
<input type="checkbox" name="checkbox" id="friday" />
<label class="slds-checkbox--button__label" for="friday">
<span class="slds-checkbox--faux">Fri</span>
</label>
</span>
</div>
</div>
</fieldset>
</aura:component>
and I have CheckboxAlternateApp where I use this component multiple time (in my case I use it three times.
I receive unexpected results displayed in this video GIF image.
When I click on the first instance it works well, but when I click on the the second and the third instances it doesn't display selected checkboxes of that instance correctly but instead unchecks or checks the checkboxes of the first instance.
Does anyone know a way to overcome this and make this work correctly?