diff --git a/packages/twenty-front/src/modules/object-record/relation-picker/components/SingleEntitySelect.tsx b/packages/twenty-front/src/modules/object-record/relation-picker/components/SingleEntitySelect.tsx index b98c3f36b0f1..19142e4bbf01 100644 --- a/packages/twenty-front/src/modules/object-record/relation-picker/components/SingleEntitySelect.tsx +++ b/packages/twenty-front/src/modules/object-record/relation-picker/components/SingleEntitySelect.tsx @@ -15,6 +15,7 @@ export type SingleEntitySelectProps = { export const SingleEntitySelect = ({ disableBackgroundBlur = false, + dropdownPlacement, EmptyIcon, emptyLabel, excludedRelationRecordIds, @@ -52,6 +53,7 @@ export const SingleEntitySelect = ({ > - onCreate?.(relationPickerSearchFilter)} - LeftIcon={IconPlus} - text="Add New" - /> - + onCreate?.(relationPickerSearchFilter)} + LeftIcon={IconPlus} + text="Add New" + /> ); const results = ( @@ -87,6 +85,10 @@ export const SingleEntitySelectMenuItemsWithSearch = ({ <> {dropdownPlacement?.includes('end') && ( <> + + {createNewButton} + + {entities.entitiesToSelect.length > 0 && } {results} @@ -97,10 +99,12 @@ export const SingleEntitySelectMenuItemsWithSearch = ({ <> {results} + {entities.entitiesToSelect.length > 0 && } + + {createNewButton} + )} - {entities.entitiesToSelect.length > 0 && } - {createNewButton} ); }; diff --git a/packages/twenty-front/src/modules/object-record/relation-picker/components/__stories__/SingleEntitySelect.stories.tsx b/packages/twenty-front/src/modules/object-record/relation-picker/components/__stories__/SingleEntitySelect.stories.tsx index 683c83459720..ddba928b6ac7 100644 --- a/packages/twenty-front/src/modules/object-record/relation-picker/components/__stories__/SingleEntitySelect.stories.tsx +++ b/packages/twenty-front/src/modules/object-record/relation-picker/components/__stories__/SingleEntitySelect.stories.tsx @@ -80,3 +80,7 @@ export const WithSearchFilter: Story = { }); }, }; + +export const WithEndPlacement: Story = { + args: { dropdownPlacement: 'bottom-end' }, +};