Fixed: Fields Disappear on Drag and Drop (#5703)

Now the fields don't disappear on drag and drop.

- After reviewing the codebase, I checked that when `inView` is true the
`RecordInlineCell` is rendered otherwise the
`StyledRecordInlineCellPlaceholder` will render which causes the fields
get disappear.
- So, I added the condition to check if `isDragSelectionStartEnabled` is
false then `StyledRecordInlineCellPlaceholder` will be rendered
otherwise `RecordInlineCell`.

fixes: #5651 



https://github.com/twentyhq/twenty/assets/140178357/022195ca-fec2-43a7-8808-f4974dbe66cf

---------

Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Shashank Vishwakarma
2024-06-03 18:45:32 +05:30
committed by GitHub
parent e49db63f30
commit a6b8beed68

View File

@ -23,6 +23,7 @@ import { Checkbox, CheckboxVariant } from '@/ui/input/components/Checkbox';
import { contextMenuIsOpenState } from '@/ui/navigation/context-menu/states/contextMenuIsOpenState';
import { contextMenuPositionState } from '@/ui/navigation/context-menu/states/contextMenuPositionState';
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
import { useDragSelect } from '@/ui/utilities/drag-select/hooks/useDragSelect';
import { ScrollWrapperContext } from '@/ui/utilities/scroll/components/ScrollWrapper';
const StyledBoardCard = styled.div<{ selected: boolean }>`
@ -199,6 +200,7 @@ export const RecordBoardCard = () => {
};
const scrollWrapperRef = useContext(ScrollWrapperContext);
const { isDragSelectionStartEnabled } = useDragSelect();
const { ref: cardRef, inView } = useInView({
root: scrollWrapperRef.current,
@ -278,7 +280,7 @@ export const RecordBoardCard = () => {
hotkeyScope: InlineCellHotkeyScope.InlineCell,
}}
>
{inView ? (
{inView || isDragSelectionStartEnabled() ? (
<RecordInlineCell />
) : (
<StyledRecordInlineCellPlaceholder />