diff --git a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.ts b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.ts index 7553d5d7f9..61ddc92f1e 100644 --- a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.ts +++ b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.ts @@ -20,6 +20,7 @@ import { ViewContainerRef, } from '@angular/core'; import { ControlValueAccessor, FormArray, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { StringCustomFieldConfig } from '@vendure/common/lib/generated-types'; import { ConfigArgType, CustomFieldType, DefaultFormComponentId } from '@vendure/common/lib/shared-types'; import { assertNever } from '@vendure/common/lib/shared-utils'; import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone'; @@ -289,12 +290,16 @@ export class DynamicFormInputComponent const type = argDef?.type as ConfigArgType | CustomFieldType; switch (type) { case 'string': - case 'localeString': - if (this.isConfigArgDef(argDef) && argDef.ui?.options) { + case 'localeString': { + const hasOptions = + !!(this.isConfigArgDef(argDef) && argDef.ui?.options) || + !!(argDef as StringCustomFieldConfig).options; + if (hasOptions) { return { component: 'select-form-input' }; } else { return { component: 'text-form-input' }; } + } case 'int': case 'float': return { component: 'number-form-input' }; diff --git a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.html b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.html index 7b83409dfb..0b30bc7765 100644 --- a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.html +++ b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.html @@ -1,5 +1,5 @@ diff --git a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.scss b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.scss index e69de29bb2..6b31dfd8f5 100644 --- a/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.scss +++ b/packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/select-form-input/select-form-input.component.scss @@ -0,0 +1,3 @@ +select { + width: 100%; +}