Fixes resetting of scroll position in RecordShowPage due to opening of some dropdowns (#6890) (#6906)
fixes #6890 --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
committed by
GitHub
parent
601e15f028
commit
72ab6bcf35
@ -1,7 +1,7 @@
|
||||
import { AvatarChip, AvatarChipVariant } from 'twenty-ui';
|
||||
|
||||
import { useRecordChipData } from '@/object-record/hooks/useRecordChipData';
|
||||
import { RecordIndexEventContext } from '@/object-record/record-index/contexts/RecordIndexEventContext';
|
||||
import { RecordIndexRootPropsContext } from '@/object-record/record-index/contexts/RecordIndexRootPropsContext';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { useContext } from 'react';
|
||||
|
||||
@ -16,7 +16,7 @@ export const RecordIdentifierChip = ({
|
||||
record,
|
||||
variant,
|
||||
}: RecordIdentifierChipProps) => {
|
||||
const { onIndexIdentifierClick } = useContext(RecordIndexEventContext);
|
||||
const { onIndexIdentifierClick } = useContext(RecordIndexRootPropsContext);
|
||||
|
||||
const { recordChipData } = useRecordChipData({
|
||||
objectNameSingular,
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
import { createEventContext } from '~/utils/createEventContext';
|
||||
|
||||
export type RecordIndexEventContextProps = {
|
||||
onIndexIdentifierClick: (recordId: string) => void;
|
||||
onIndexRecordsLoaded: () => void;
|
||||
};
|
||||
|
||||
export const RecordIndexEventContext =
|
||||
createEventContext<RecordIndexEventContextProps>();
|
||||
@ -20,7 +20,7 @@ import { useClickOutsideListener } from '@/ui/utilities/pointer-event/hooks/useC
|
||||
import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
import { RecordIndexEventContext } from '@/object-record/record-index/contexts/RecordIndexEventContext';
|
||||
import { RecordIndexRootPropsContext } from '@/object-record/record-index/contexts/RecordIndexRootPropsContext';
|
||||
import { useContext } from 'react';
|
||||
import { TableHotkeyScope } from '../../types/TableHotkeyScope';
|
||||
|
||||
@ -41,7 +41,7 @@ export type OpenTableCellArgs = {
|
||||
};
|
||||
|
||||
export const useOpenRecordTableCellV2 = (tableScopeId: string) => {
|
||||
const { onIndexIdentifierClick } = useContext(RecordIndexEventContext);
|
||||
const { onIndexIdentifierClick } = useContext(RecordIndexRootPropsContext);
|
||||
const moveEditModeToTableCellPosition =
|
||||
useMoveEditModeToTableCellPosition(tableScopeId);
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import { useInView } from 'react-intersection-observer';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { getBasePathToShowPage } from '@/object-metadata/utils/getBasePathToShowPage';
|
||||
import { RecordIndexEventContext } from '@/object-record/record-index/contexts/RecordIndexEventContext';
|
||||
import { RecordIndexRootPropsContext } from '@/object-record/record-index/contexts/RecordIndexRootPropsContext';
|
||||
import { RecordTableContext } from '@/object-record/record-table/contexts/RecordTableContext';
|
||||
import { RecordTableRowContext } from '@/object-record/record-table/contexts/RecordTableRowContext';
|
||||
import { useRecordTableStates } from '@/object-record/record-table/hooks/internal/useRecordTableStates';
|
||||
@ -24,7 +24,7 @@ export const RecordTableRowWrapper = ({
|
||||
children: ReactNode;
|
||||
}) => {
|
||||
const { objectMetadataItem } = useContext(RecordTableContext);
|
||||
const { onIndexRecordsLoaded } = useContext(RecordIndexEventContext);
|
||||
const { onIndexRecordsLoaded } = useContext(RecordIndexRootPropsContext);
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user