From 73179baa35f074da972201377fc495097e1ddf98 Mon Sep 17 00:00:00 2001 From: endy Date: Thu, 9 Nov 2017 01:19:34 +0500 Subject: [PATCH] fix(entity-select-input): Fix error if selected empty value on modal for list --- .../content-type-select-input.component.ts | 2 +- .../group-select-input/group-select-input.component.ts | 2 +- .../users-grid/user-select-input/user-select-input.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/web/src/grids/content-types-grid/content-type-select-input/content-type-select-input.component.ts b/libs/web/src/grids/content-types-grid/content-type-select-input/content-type-select-input.component.ts index 4d8a60c1..57b54835 100644 --- a/libs/web/src/grids/content-types-grid/content-type-select-input/content-type-select-input.component.ts +++ b/libs/web/src/grids/content-types-grid/content-type-select-input/content-type-select-input.component.ts @@ -64,7 +64,7 @@ export class ContentTypeSelectInputComponent extends BaseResourceSelectInputComp itemModal.onOk.subscribe(($event: any) => { this.value = itemModal.item; if (this.inputElement) { - this.inputElement.value = this.value.pk; + this.inputElement.value = this.value ? this.value.pk : null; } if (this.inputReadonly === false) { this.valueAsString = ''; diff --git a/libs/web/src/grids/groups-grid/group-select-input/group-select-input.component.ts b/libs/web/src/grids/groups-grid/group-select-input/group-select-input.component.ts index a340fae7..7d993fc2 100644 --- a/libs/web/src/grids/groups-grid/group-select-input/group-select-input.component.ts +++ b/libs/web/src/grids/groups-grid/group-select-input/group-select-input.component.ts @@ -58,7 +58,7 @@ export class GroupSelectInputComponent extends BaseResourceSelectInputComponent itemModal.onOk.subscribe(($event: any) => { this.value = itemModal.item; if (this.inputElement) { - this.inputElement.value = this.value.pk; + this.inputElement.value = this.value ? this.value.pk : null; } if (this.inputReadonly === false) { this.valueAsString = ''; diff --git a/libs/web/src/grids/users-grid/user-select-input/user-select-input.component.ts b/libs/web/src/grids/users-grid/user-select-input/user-select-input.component.ts index 43b99d66..76348c05 100644 --- a/libs/web/src/grids/users-grid/user-select-input/user-select-input.component.ts +++ b/libs/web/src/grids/users-grid/user-select-input/user-select-input.component.ts @@ -58,7 +58,7 @@ export class UserSelectInputComponent extends BaseResourceSelectInputComponent { itemModal.onOk.subscribe(($event: any) => { this.value = itemModal.item; if (this.inputElement) { - this.inputElement.value = this.value.pk; + this.inputElement.value = this.value ? this.value.pk : null; } if (this.inputReadonly === false) { this.valueAsString = '';