Skip to content
Snippets Groups Projects
Commit 563a9f64 authored by jojohoch's avatar jojohoch
Browse files

[player] Show validation errors of drop lists

parent 9ee5558f
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ import { FormElementComponent } from '../../directives/form-element-component.di ...@@ -17,6 +17,7 @@ import { FormElementComponent } from '../../directives/form-element-component.di
iOS 14 is not able to determine the height of the flex container--> iOS 14 is not able to determine the height of the flex container-->
<div class="list" <div class="list"
[ngClass]="{ 'align-flex' : elementModel.orientation === 'flex', 'copyOnDrop': elementModel.copyOnDrop }" [ngClass]="{ 'align-flex' : elementModel.orientation === 'flex', 'copyOnDrop': elementModel.copyOnDrop }"
[class.errors]="elementFormControl.errors && elementFormControl.touched"
[style.min-height.px]="elementModel.position.useMinHeight ? elementModel.height - 6 : null" [style.min-height.px]="elementModel.position.useMinHeight ? elementModel.height - 6 : null"
[class.dropList-highlight]="elementModel.highlightReceivingDropList" [class.dropList-highlight]="elementModel.highlightReceivingDropList"
[style.outline-color]="elementModel.highlightReceivingDropListColor" [style.outline-color]="elementModel.highlightReceivingDropListColor"
...@@ -115,6 +116,7 @@ import { FormElementComponent } from '../../directives/form-element-component.di ...@@ -115,6 +116,7 @@ import { FormElementComponent } from '../../directives/form-element-component.di
'.copyOnDrop .item {transform: none !important}', '.copyOnDrop .item {transform: none !important}',
'.vertical-orientation.item:not(:last-child) {margin-bottom: 5px;}', '.vertical-orientation.item:not(:last-child) {margin-bottom: 5px;}',
'.horizontal-orientation.item:not(:last-child) {margin-right: 5px}', '.horizontal-orientation.item:not(:last-child) {margin-right: 5px}',
'.errors {outline: 2px solid #f44336 !important;}',
'.error-message {font-size: 75%; margin-top: 10px;}', // TODO error message? '.error-message {font-size: 75%; margin-top: 10px;}', // TODO error message?
'.cdk-drag-preview {padding: 8px 20px; border-radius: 10px; z-index: 5;}', '.cdk-drag-preview {padding: 8px 20px; border-radius: 10px; z-index: 5;}',
'.drag-placeholder {background-color: lightgrey; border: dotted 3px #999; padding: 10px;}', '.drag-placeholder {background-color: lightgrey; border: dotted 3px #999; padding: 10px;}',
...@@ -152,6 +154,7 @@ export class DropListComponent extends FormElementComponent { ...@@ -152,6 +154,7 @@ export class DropListComponent extends FormElementComponent {
this.elementFormControl.setValue( this.elementFormControl.setValue(
(event.container.data.elementFormControl.value as DragNDropValueObject[]) (event.container.data.elementFormControl.value as DragNDropValueObject[])
); );
event.container.data.elementFormControl.markAsTouched();
} else { } else {
const presentValueIDs = event.container.data.elementFormControl.value const presentValueIDs = event.container.data.elementFormControl.value
.map((value2: DragNDropValueObject) => value2.id); .map((value2: DragNDropValueObject) => value2.id);
...@@ -166,6 +169,8 @@ export class DropListComponent extends FormElementComponent { ...@@ -166,6 +169,8 @@ export class DropListComponent extends FormElementComponent {
(event.previousContainer.data.elementFormControl.value as DragNDropValueObject[]) (event.previousContainer.data.elementFormControl.value as DragNDropValueObject[])
); );
} }
event.container.data.elementFormControl.markAsTouched();
event.previousContainer.data.elementFormControl.markAsTouched();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment