From a6b8beed68573f3cd3cb9724b71654869454233d Mon Sep 17 00:00:00 2001 From: Shashank Vishwakarma Date: Mon, 3 Jun 2024 18:45:32 +0530 Subject: [PATCH] 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 --- .../record-board-card/components/RecordBoardCard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx index 9b695a3f3..5f1c139d2 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx @@ -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() ? ( ) : (