[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

@@ -84,7 +84,9 @@ export class CardViewTextItemComponent implements OnChanges {
}, 0);
}
reset(): void {
reset(event: MouseEvent|KeyboardEvent): void {
event.stopPropagation();
this.editedValue = this.property.multiline ? this.property.displayValue : this.property.value;
this.setEditMode(false);
this.resetErrorMessages();
@@ -94,7 +96,9 @@ export class CardViewTextItemComponent implements OnChanges {
this.errorMessages = [];
}
update(): void {
update(event: MouseEvent|KeyboardEvent): void {
event.stopPropagation();
if (this.property.isValid(this.editedValue)) {
const updatedValue = this.prepareValueForUpload(this.property, this.editedValue);
this.cardViewUpdateService.update(this.property, updatedValue);