diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx index 1cb95c4d3e..3de2b12bd0 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx @@ -44,6 +44,8 @@ export const OwnerPicker = ( ...restProps } = props; + const defaultNamespace = uiSchema['ui:options']?.defaultNamespace; + const ownerUiSchema = { ...uiSchema, 'ui:options': { @@ -54,7 +56,7 @@ export const OwnerPicker = ( defaultKind: 'Group', allowArbitraryValues: uiSchema['ui:options']?.allowArbitraryValues ?? true, - defaultNamespace: uiSchema['ui:options']?.defaultNamespace ?? '', + ...(defaultNamespace !== undefined ? { defaultNamespace } : {}), }, };