diff --git a/docs/release-notes-player.txt b/docs/release-notes-player.txt index 63ecf615f221681f95e7d08865e8ed10dafef35f..b9066e7fe97d0949dac5d4d8812b0fde6efcdb3b 100644 --- a/docs/release-notes-player.txt +++ b/docs/release-notes-player.txt @@ -4,7 +4,7 @@ Player - Improve performance by reducing the frequency of change notifications to the host - Display pages in scroll mode without generated spacing - Add scroll buttons to pages that can be scrolled -- Add validation error functionality to cloze elements +- Display validation errors for children of cloze elements and for drop lists - Fix reset option of dropdown element 1.25.2 diff --git a/projects/common/components/compound-elements/cloze/cloze-child-elements/drop-list-simple.component.ts b/projects/common/components/compound-elements/cloze/cloze-child-elements/drop-list-simple.component.ts index fe5d8e67a88c738fcab0127e585f8cfb9916df50..b11f046128ed4dfd3c37e82dddf9ee7cb6907b40 100644 --- a/projects/common/components/compound-elements/cloze/cloze-child-elements/drop-list-simple.component.ts +++ b/projects/common/components/compound-elements/cloze/cloze-child-elements/drop-list-simple.component.ts @@ -34,6 +34,8 @@ import { DragNDropValueObject } from 'common/models/elements/element'; [cdkDropListData]="this" [cdkDropListConnectedTo]="elementModel.connectedTo" [cdkDropListEnterPredicate]="onlyOneItemPredicate" + tabindex="0" + (focusout)="elementFormControl.markAsTouched()" (cdkDropListDropped)="drop($event)"> <ng-container *ngIf="!parentForm"> <ng-container *ngFor="let dropListValueElement of $any(elementModel.value)"> @@ -110,7 +112,6 @@ export class DropListSimpleComponent extends FormElementComponent { this.elementFormControl.setValue( (event.container.data.elementFormControl.value as DragNDropValueObject[]) ); - event.container.data.elementFormControl.markAsTouched(); } else { transferArrayItem( event.previousContainer.data.elementFormControl.value as unknown as DragNDropValueObject[], @@ -125,8 +126,6 @@ export class DropListSimpleComponent extends FormElementComponent { this.elementFormControl.setValue( (event.container.data.elementFormControl.value as DragNDropValueObject[]) ); - event.container.data.elementFormControl.markAsTouched(); - event.previousContainer.data.elementFormControl.markAsTouched(); } } diff --git a/projects/common/components/input-elements/drop-list.component.ts b/projects/common/components/input-elements/drop-list.component.ts index 79acca7f3840fd0a41efb70c791abdeecb2b689e..23a47f09ca2d3c7be90430b9f408c662ee8d942d 100644 --- a/projects/common/components/input-elements/drop-list.component.ts +++ b/projects/common/components/input-elements/drop-list.component.ts @@ -36,6 +36,8 @@ import { FormElementComponent } from '../../directives/form-element-component.di [cdkDropListConnectedTo]="elementModel.connectedTo" [cdkDropListOrientation]="elementModel.orientation !== 'flex' ? $any(elementModel.orientation) : ''" [cdkDropListEnterPredicate]="onlyOneItemPredicate" + tabindex="0" + (focusout)="elementFormControl.markAsTouched()" (cdkDropListDropped)="drop($event)"> <ng-container *ngIf="!parentForm"> @@ -154,7 +156,6 @@ export class DropListComponent extends FormElementComponent { this.elementFormControl.setValue( (event.container.data.elementFormControl.value as DragNDropValueObject[]) ); - event.container.data.elementFormControl.markAsTouched(); } else { const presentValueIDs = event.container.data.elementFormControl.value .map((value2: DragNDropValueObject) => value2.id); @@ -169,8 +170,6 @@ export class DropListComponent extends FormElementComponent { (event.previousContainer.data.elementFormControl.value as DragNDropValueObject[]) ); } - event.container.data.elementFormControl.markAsTouched(); - event.previousContainer.data.elementFormControl.markAsTouched(); } }