[ADF-4995] Metadata - edit mode cannot be access via keyboard (#5253)

* use keydown over keyup

* fix test

* fix tests
This commit is contained in:
Cilibiu Bogdan
2019-11-15 16:33:12 +02:00
committed by Eugenio Romano
parent 3dd43ce9b5
commit 81dcfa4341
3 changed files with 23 additions and 18 deletions

View File

@@ -38,8 +38,8 @@
<div class="adf-textitem-editable-controls">
<mat-form-field floatPlaceholder="never" class="adf-input-container">
<input *ngIf="!property.multiline" #editorInput
(keyup.escape)="reset()"
(keyup.enter)="update()"
(keydown.escape)="reset($event)"
(keydown.enter)="update($event)"
matInput
class="adf-input"
[placeholder]="property.default | translate"
@@ -56,7 +56,7 @@
(input)="onTextAreaInputChange()"
[attr.data-automation-id]="'card-textitem-edittextarea-' + property.key"></textarea>
</mat-form-field>
<button mat-icon-button class="adf-textitem-action" (click)="update()"
<button mat-icon-button class="adf-textitem-action" (click)="update($event)"
[attr.aria-label]="'CORE.METADATA.ACTIONS.SAVE' | translate"
[attr.title]="'CORE.METADATA.ACTIONS.SAVE' | translate"
[attr.data-automation-id]="'card-textitem-update-' + property.key">
@@ -64,7 +64,7 @@
<mat-icon class="adf-textitem-icon">done</mat-icon>
</button>
<button mat-icon-button (click)="reset()" class="adf-textitem-action"
<button mat-icon-button (click)="reset($event)" class="adf-textitem-action"
[attr.aria-label]="'CORE.METADATA.ACTIONS.CANCEL' | translate"
[attr.title]="'CORE.METADATA.ACTIONS.CANCEL' | translate"
[attr.data-automation-id]="'card-textitem-reset-' + property.key">