Skip to content

Commit

Permalink
Fix saving via enter key in list view
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Dec 20, 2024
1 parent fb2bf2c commit 4d61960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion desktop/src/app/components/resources/list/row.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ export class RowComponent implements AfterViewInit {
}


public async onInput(event: KeyboardEvent, fieldName: string) {
public onInput(event: KeyboardEvent, fieldName: string) {

this.setValue(fieldName, event.target['value']);
}


public async onKeyUp(event: KeyboardEvent, fieldName: string) {

if (event.key === 'Enter') {
await this.stopEditing(fieldName, this.document.resource[fieldName]);
Expand Down
2 changes: 2 additions & 0 deletions desktop/src/app/components/resources/list/row.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@
(focus)="startEditing('identifier', document.resource.identifier)"
(blur)="stopEditing('identifier', document.resource.identifier)"
(input)="onInput($event, 'identifier')"
(keyup)="onKeyUp($event, 'identifier')"
(dblclick)="$event.stopPropagation();" class="form-control form-control-sm identifier-input">
</div>
<div *ngIf="!shortDescriptionValuelist" class="input-field">
<input [value]="getShortDescription()"
(focus)="startEditing('shortDescription', document.resource.shortDescription)"
(blur)="stopEditing('shortDescription', document.resource.shortDescription)"
(input)="onInput($event, 'shortDescription')"
(keyup)="onKeyUp($event, 'shortDescription')"
(dblclick)="$event.stopPropagation();"
class="form-control form-control-sm">
</div>
Expand Down

0 comments on commit 4d61960

Please sign in to comment.