Skip to content

Commit

Permalink
Remove focusout submits the field
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Oct 7, 2024
1 parent 0adec2f commit 2b0e31f
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { EditFieldHandler } from 'core-app/shared/components/fields/edit/editing-portal/edit-field-handler';
import {
ElementRef, Injector, OnInit, Directive,
} from '@angular/core';
import { Directive, ElementRef, Injector, OnInit } from '@angular/core';
import { IFieldSchema } from 'core-app/shared/components/fields/field.base';
import { Subject } from 'rxjs';
import { WorkPackageChangeset } from 'core-app/features/work-packages/components/wp-edit/work-package-changeset';
Expand Down Expand Up @@ -86,9 +84,6 @@ export abstract class WorkPackageCommentFieldHandler extends EditFieldHandler im
trigger && trigger.focus();
}

onFocusOut():void {
}

handleUserKeydown(event:JQuery.TriggeredEvent, onlyCancel?:boolean):void {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ export abstract class EditFieldHandler extends UntilDestroyedMixin {
*/
public abstract isChanged():boolean;

/**
* Handle focus loss
*/
public abstract onFocusOut():void;

public abstract setErrors(newErrors:string[]):void;

public previewContext(resource:HalResource):string|undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,6 @@ export class HalResourceEditFieldHandler extends EditFieldHandler {
}
}

public async onFocusOut() {
// In case of inline create or erroneous forms: do not save on focus loss
// const specialField = this.resource.shouldCloseOnFocusOut(this.fieldName);
if (this.resource.subject && this.withErrors && this.withErrors.length === 0) {
await this.handleUserSubmit();
}
}

public setErrors(newErrors:string[]) {
this.errors = newErrors;
this.element.classList.toggle('-error', this.isErrorenous);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { EditFieldComponent } from 'core-app/shared/components/fields/edit/edit-
[disabled]="inFlight"
[(ngModel)]="value"
(keydown)="handler.handleUserKeydown($event)"
(focusout)="handler.onFocusOut()"
[attr.lang]="locale"
[id]="handler.htmlId" />
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { EditFieldComponent } from 'core-app/shared/components/fields/edit/edit-
[attr.lang]="locale"
[(ngModel)]="value"
(keydown)="handler.handleUserKeydown($event)"
(focusout)="handler.onFocusOut()"
[id]="handler.htmlId" />
`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
[disabled]="inFlight"
[(ngModel)]="value"
(keydown)="handler.handleUserKeydown($event)"
(focusout)="handler.onFocusOut()"
[id]="handler.htmlId"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export class CustomTextEditFieldService extends EditFieldHandler {
super();
}

onFocusOut():void {
// interface
}

public initialize(value:GridWidgetResource) {
this.initializeChangeset(value);
this.valueChanged$ = new BehaviorSubject(value.options.text as string);
Expand Down

0 comments on commit 2b0e31f

Please sign in to comment.