From 14dcebca7dc87784fab4dc1012020368256d0968 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Thu, 3 Mar 2022 10:35:47 +0100 Subject: [PATCH] [player] Disable automatic capitalization and spelling correction (iPad) - Use the attributes autocapitalize, autocorrect, spellcheck - Replace [value]="elementModel.value" with value="{{elementModel.value}}" to prevent lint errors --- .../ui-elements/text-area.component.ts | 8 ++++++-- .../ui-elements/text-field-simple.component.ts | 4 ++++ .../ui-elements/text-field.component.ts | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/projects/common/components/ui-elements/text-area.component.ts b/projects/common/components/ui-elements/text-area.component.ts index cf346635e..22d1e8d0e 100644 --- a/projects/common/components/ui-elements/text-area.component.ts +++ b/projects/common/components/ui-elements/text-area.component.ts @@ -22,9 +22,13 @@ import { TextAreaElement } from '../../interfaces/elements'; [appearance]="$any(elementModel.appearance)"> <mat-label *ngIf="elementModel.label">{{elementModel.label}}</mat-label> <textarea matInput #input - autocomplete="off" rows="{{elementModel.rowCount}}" + autocomplete="off" + autocapitalize="none" + autocorrect="off" + spellcheck="false" + rows="{{elementModel.rowCount}}" + value="{{elementModel.value}}" [formControl]="elementFormControl" - [value]="elementModel.value" [readonly]="elementModel.readOnly" [style.min-width.%]="100" [style.line-height.%]="elementModel.styling.lineHeight" diff --git a/projects/common/components/ui-elements/text-field-simple.component.ts b/projects/common/components/ui-elements/text-field-simple.component.ts index 621faa31d..8651ec386 100644 --- a/projects/common/components/ui-elements/text-field-simple.component.ts +++ b/projects/common/components/ui-elements/text-field-simple.component.ts @@ -6,6 +6,10 @@ import { TextFieldSimpleElement } from '../../interfaces/elements'; selector: 'aspect-text-field-simple', template: ` <input type="text" form="parentForm" + autocomplete="off" + autocapitalize="none" + autocorrect="off" + spellcheck="false" [style.width.px]="elementModel.width" [style.height.px]="elementModel.height" [style.line-height.px]="elementModel.styling.fontSize" diff --git a/projects/common/components/ui-elements/text-field.component.ts b/projects/common/components/ui-elements/text-field.component.ts index 4743da198..2f470928f 100644 --- a/projects/common/components/ui-elements/text-field.component.ts +++ b/projects/common/components/ui-elements/text-field.component.ts @@ -20,9 +20,13 @@ import { TextFieldElement } from '../../interfaces/elements'; aspectInputBackgroundColor [backgroundColor]="elementModel.styling.backgroundColor" [appearance]="$any(elementModel.appearance)"> <mat-label>{{elementModel.label}}</mat-label> - <input matInput type="text" #input autocomplete="off" + <input matInput type="text" #input + autocomplete="off" + autocapitalize="none" + autocorrect="off" + spellcheck="false" + value="{{elementModel.value}}" [formControl]="elementFormControl" - [value]="elementModel.value" [pattern]="elementModel.pattern" [readonly]="elementModel.readOnly" (focus)="elementModel.inputAssistancePreset !== 'none' ? onFocusChanged.emit(input) : null" @@ -48,9 +52,13 @@ import { TextFieldElement } from '../../interfaces/elements'; [style.text-decoration]="elementModel.styling.underline ? 'underline' : ''" aspectInputBackgroundColor [backgroundColor]="elementModel.styling.backgroundColor" [appearance]="$any(elementModel.appearance)"> - <input matInput type="text" #input autocomplete="off" + <input matInput type="text" #input + autocomplete="off" + autocapitalize="none" + autocorrect="off" + spellcheck="false" + value="{{elementModel.value}}" [formControl]="elementFormControl" - [value]="elementModel.value" [readonly]="elementModel.readOnly" [pattern]="elementModel.pattern" (focus)="elementModel.inputAssistancePreset !== 'none' ? onFocusChanged.emit(input) : null" -- GitLab