diff --git a/projects/common/components/input-elements/math-field.component.ts b/projects/common/components/input-elements/math-field.component.ts index df1165464577428499d3442882b69a7e7e7ad08e..ae25ca33c44f19f83d8dd3f149dfafd1ddf36f6e 100644 --- a/projects/common/components/input-elements/math-field.component.ts +++ b/projects/common/components/input-elements/math-field.component.ts @@ -15,10 +15,12 @@ import { MathFieldElement } from 'common/models/elements/input-elements/math-fie (input)="elementFormControl.setValue($any($event.target).value)" (focusout)="elementFormControl.markAsTouched()"> </aspect-mathlive-math-field> - <mat-error *ngIf="elementFormControl.errors"> + <mat-error *ngIf="elementFormControl.errors && elementFormControl.touched" + class="error-message"> {{elementFormControl.errors | errorTransform: elementModel}} </mat-error> - ` + `, + styles: ['.error-message {font-size: 75%; margin-top: 15px; margin-left: 10px;}'] }) export class MathFieldComponent extends FormElementComponent { @Input() elementModel!: MathFieldElement;