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

Rename event onKeyDown to hardwareKeyDetected

parent 7c388331
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell ...@@ -31,7 +31,7 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell
[style.font-style]="elementModel.styling.italic ? 'italic' : ''" [style.font-style]="elementModel.styling.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.styling.underline ? 'underline' : ''" [style.text-decoration]="elementModel.styling.underline ? 'underline' : ''"
[formControl]="elementFormControl" [formControl]="elementFormControl"
(keydown)="elementModel.showSoftwareKeyboard ? onKeyDown.emit(input) : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit(input) : null"
(focus)="focusChanged.emit(input)" (focus)="focusChanged.emit(input)"
(blur)="focusChanged.emit(null)"> (blur)="focusChanged.emit(null)">
</mat-form-field> </mat-form-field>
...@@ -68,6 +68,6 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell ...@@ -68,6 +68,6 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell
export class SpellCorrectComponent extends FormElementComponent { export class SpellCorrectComponent extends FormElementComponent {
@Input() elementModel!: SpellCorrectElement; @Input() elementModel!: SpellCorrectElement;
@Output() focusChanged = new EventEmitter<HTMLElement | null>(); @Output() focusChanged = new EventEmitter<HTMLElement | null>();
@Output() onKeyDown = new EventEmitter<HTMLElement>(); @Output() hardwareKeyDetected = new EventEmitter<HTMLElement>();
@ViewChild(MatInput) inputElement!: MatInput; @ViewChild(MatInput) inputElement!: MatInput;
} }
...@@ -34,7 +34,7 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area ...@@ -34,7 +34,7 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area
[style.min-width.%]="100" [style.min-width.%]="100"
[style.line-height.%]="elementModel.styling.lineHeight" [style.line-height.%]="elementModel.styling.lineHeight"
[style.resize]="elementModel.resizeEnabled ? 'both' : 'none'" [style.resize]="elementModel.resizeEnabled ? 'both' : 'none'"
(keydown)="elementModel.showSoftwareKeyboard ? onKeyDown.emit(input) : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit(input) : null"
(focus)="focusChanged.emit(input)" (focus)="focusChanged.emit(input)"
(blur)="focusChanged.emit(null)"> (blur)="focusChanged.emit(null)">
</textarea> </textarea>
...@@ -51,5 +51,5 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area ...@@ -51,5 +51,5 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area
export class TextAreaComponent extends FormElementComponent { export class TextAreaComponent extends FormElementComponent {
@Input() elementModel!: TextAreaElement; @Input() elementModel!: TextAreaElement;
@Output() focusChanged = new EventEmitter<HTMLElement | null>(); @Output() focusChanged = new EventEmitter<HTMLElement | null>();
@Output() onKeyDown = new EventEmitter<HTMLElement>(); @Output() hardwareKeyDetected = new EventEmitter<HTMLElement>();
} }
...@@ -30,7 +30,7 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie ...@@ -30,7 +30,7 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie
[formControl]="elementFormControl" [formControl]="elementFormControl"
[pattern]="$any(elementModel.pattern)" [pattern]="$any(elementModel.pattern)"
[readonly]="elementModel.readOnly" [readonly]="elementModel.readOnly"
(keydown)="elementModel.showSoftwareKeyboard ? onKeyDown.emit(input) : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit(input) : null"
(focus)="focusChanged.emit(input)" (focus)="focusChanged.emit(input)"
(blur)="focusChanged.emit(null)"> (blur)="focusChanged.emit(null)">
<button *ngIf="elementModel.clearable" <button *ngIf="elementModel.clearable"
...@@ -51,6 +51,6 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie ...@@ -51,6 +51,6 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie
}) })
export class TextFieldComponent extends FormElementComponent { export class TextFieldComponent extends FormElementComponent {
@Input() elementModel!: TextFieldElement; @Input() elementModel!: TextFieldElement;
@Output() onKeyDown = new EventEmitter<HTMLElement>(); @Output() hardwareKeyDetected = new EventEmitter<HTMLElement>();
@Output() focusChanged = new EventEmitter<HTMLElement | null>(); @Output() focusChanged = new EventEmitter<HTMLElement | null>();
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#elementComponent #elementComponent
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: TextAreaElement" [elementModel]="elementModel | cast: TextAreaElement"
(onKeyDown)="detectHardwareKeyboard($event, elementComponent)" (hardwareKeyDetected)="detectHardwareKeyboard($event, elementComponent)"
(focusChanged)="onFocusChanged($event, elementComponent)"> (focusChanged)="onFocusChanged($event, elementComponent)">
</aspect-text-area> </aspect-text-area>
<aspect-text-field <aspect-text-field
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#elementComponent #elementComponent
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: TextFieldElement" [elementModel]="elementModel | cast: TextFieldElement"
(onKeyDown)="detectHardwareKeyboard($event, elementComponent)" (hardwareKeyDetected)="detectHardwareKeyboard($event, elementComponent)"
(focusChanged)="onFocusChanged($event, elementComponent)"> (focusChanged)="onFocusChanged($event, elementComponent)">
</aspect-text-field> </aspect-text-field>
<aspect-spell-correct <aspect-spell-correct
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#elementComponent #elementComponent
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: SpellCorrectElement" [elementModel]="elementModel | cast: SpellCorrectElement"
(onKeyDown)="detectHardwareKeyboard($event, elementComponent)" (hardwareKeyDetected)="detectHardwareKeyboard($event, elementComponent)"
(focusChanged)="onFocusChanged($event, elementComponent)"> (focusChanged)="onFocusChanged($event, elementComponent)">
</aspect-spell-correct> </aspect-spell-correct>
</form> </form>
......
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