Revert "fix: prevent default object re-selection in relation field fo… (#17619)
I suggest to revert [this PR](https://github.com/twentyhq/twenty/pull/17313) as it had already been fixed [in this PR](https://github.com/twentyhq/twenty/pull/17209/changes) (which fixes more than it says in its title). Issue was tracked by [this ticket](https://github.com/twentyhq/core-team-issues/issues/2049) not very explicit - sorry, my fault. Code added in the PR does not add value
This commit is contained in:
+1
-3
@@ -1,5 +1,5 @@
|
||||
import styled from '@emotion/styled';
|
||||
import { plural, t } from '@lingui/core/macro';
|
||||
import { plural } from '@lingui/core/macro';
|
||||
import { useMemo, useRef, useState, type MouseEvent } from 'react';
|
||||
|
||||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||
@@ -191,7 +191,6 @@ export const SettingsMorphRelationMultiSelect = ({
|
||||
isDisabled={isDisabled}
|
||||
selectSizeVariant={selectSizeVariant}
|
||||
hasRightElement={hasRightElement}
|
||||
placeholderText={t`Select objects...`}
|
||||
/>
|
||||
) : (
|
||||
<Dropdown
|
||||
@@ -214,7 +213,6 @@ export const SettingsMorphRelationMultiSelect = ({
|
||||
isDisabled={isDisabled}
|
||||
selectSizeVariant={selectSizeVariant}
|
||||
hasRightElement={hasRightElement}
|
||||
placeholderText={t`Select objects...`}
|
||||
/>
|
||||
}
|
||||
dropdownComponents={
|
||||
|
||||
+4
-9
@@ -17,7 +17,6 @@ import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useMemo } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { RelationType } from '~/generated-metadata/graphql';
|
||||
|
||||
@@ -115,14 +114,10 @@ export const SettingsDataModelFieldRelationForm = ({
|
||||
relationType: initialRelationType,
|
||||
});
|
||||
|
||||
const initialMorphRelationsObjectMetadataIds = useMemo(
|
||||
() =>
|
||||
initialRelationObjectMetadataItems.map(
|
||||
(relationObjectMetadataItem) => relationObjectMetadataItem.id,
|
||||
),
|
||||
[initialRelationObjectMetadataItems],
|
||||
);
|
||||
|
||||
const initialMorphRelationsObjectMetadataIds =
|
||||
initialRelationObjectMetadataItems.map(
|
||||
(relationObjectMetadataItem) => relationObjectMetadataItem.id,
|
||||
);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user