Skip to content

Commit

Permalink
editor: fix toggle wrapper if many
Browse files Browse the repository at this point in the history
When there are many toggle wrappers on the same page, the 'click'
behavior is wrong: whatever switch button is clicked, only the first
element is toggled. This pull request fixes it.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai authored and Sébastien Délèze committed Oct 21, 2020
1 parent 9e38129 commit 6e8510f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import { isEmpty, removeEmptyValues } from '../../utils';
<div class='toggle-wrapper'>
<div class='form-group'>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="toggle-switch" (change)="toggle($event)" [checked]="tsOptions.enabled">
<label class="custom-control-label" for="toggle-switch" [tooltip]="tsOptions.description">{{ tsOptions.label }}</label>
<input class="custom-control-input" type="checkbox" id="toggle-switch-{{ field.id }}" \
(change)="toggle($event)" [checked]="tsOptions.enabled">
<label class="custom-control-label" for="toggle-switch-{{ field.id }}" \
[tooltip]="tsOptions.description">{{ tsOptions.label }}</label>
</div>
</div>
<ng-container *ngIf="tsOptions.enabled" #fieldComponent></ng-container>
Expand Down

0 comments on commit 6e8510f

Please sign in to comment.