Merge pull request #4668 from GabrielInTheWorld/fixes-checkbox

Fixes state of the checkboxes in amendments
This commit is contained in:
Emanuel Schütze 2019-05-07 17:25:09 +02:00 committed by GitHub
commit 5d64ea1519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -30,12 +30,15 @@
*ngIf="multipleParagraphsAllowed"
class="paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-checkbox>
(click)="checkboxClicked($event)"
>
</mat-checkbox>
<mat-radio-button
*ngIf="!multipleParagraphsAllowed"
class="paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-radio-button>
>
</mat-radio-button>
<div class="paragraph-text motion-text" [innerHTML]="paragraph.safeHtml"></div>
</section>
</div>

View File

@ -117,6 +117,16 @@ export class AmendmentCreateWizardComponent extends BaseViewComponent {
return !!this.contentForm.value.selectedParagraphs.find(para => para.paragraphNo === paragraph.paragraphNo);
}
/**
* Function to prevent executing the click event of a checkbox.
* This prevents that the state of the checkbox is not changed by clicking it.
*
* @param event The `MouseEvent`
*/
public checkboxClicked(event: MouseEvent): void {
event.preventDefault();
}
/**
* Called by the template when a paragraph is clicked in single paragraph mode.
* Behaves like a radio-button