Fix click outside for RecordDetailRelationSection (#11072)
Fixes https://github.com/twentyhq/twenty/issues/11061
This commit is contained in:
@ -262,6 +262,7 @@ export const RecordDetailRelationSection = ({
|
|||||||
accent="tertiary"
|
accent="tertiary"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
dropdownHotkeyScope={{ scope: dropdownId }}
|
||||||
dropdownComponents={
|
dropdownComponents={
|
||||||
isToOneObject ? (
|
isToOneObject ? (
|
||||||
<SingleRecordPicker
|
<SingleRecordPicker
|
||||||
@ -271,6 +272,7 @@ export const RecordDetailRelationSection = ({
|
|||||||
objectNameSingular={relationObjectMetadataNameSingular}
|
objectNameSingular={relationObjectMetadataNameSingular}
|
||||||
recordPickerInstanceId={dropdownId}
|
recordPickerInstanceId={dropdownId}
|
||||||
onCreate={createNewRecordAndOpenRightDrawer}
|
onCreate={createNewRecordAndOpenRightDrawer}
|
||||||
|
onCancel={closeDropdown}
|
||||||
layoutDirection={
|
layoutDirection={
|
||||||
dropdownPlacement?.includes('end')
|
dropdownPlacement?.includes('end')
|
||||||
? 'search-bar-on-bottom'
|
? 'search-bar-on-bottom'
|
||||||
@ -295,7 +297,6 @@ export const RecordDetailRelationSection = ({
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
dropdownHotkeyScope={{ scope: dropdownId }}
|
|
||||||
/>
|
/>
|
||||||
</DropdownScope>
|
</DropdownScope>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -15,12 +15,12 @@ import {
|
|||||||
useFloating,
|
useFloating,
|
||||||
} from '@floating-ui/react';
|
} from '@floating-ui/react';
|
||||||
import { MouseEvent, ReactNode } from 'react';
|
import { MouseEvent, ReactNode } from 'react';
|
||||||
|
import { flushSync } from 'react-dom';
|
||||||
import { Keys } from 'react-hotkeys-hook';
|
import { Keys } from 'react-hotkeys-hook';
|
||||||
import { useRecoilCallback } from 'recoil';
|
import { useRecoilCallback } from 'recoil';
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { sleep } from '~/utils/sleep';
|
import { sleep } from '~/utils/sleep';
|
||||||
import { useDropdown } from '../hooks/useDropdown';
|
import { useDropdown } from '../hooks/useDropdown';
|
||||||
import { flushSync } from 'react-dom';
|
|
||||||
|
|
||||||
const StyledDropdownFallbackAnchor = styled.div`
|
const StyledDropdownFallbackAnchor = styled.div`
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user