Skip to content

Commit eec2221

Browse files
Fixed: Fields Disappear on Drag and Drop (twentyhq#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: twentyhq#5651 https://github.com/twentyhq/twenty/assets/140178357/022195ca-fec2-43a7-8808-f4974dbe66cf --------- Co-authored-by: martmull <[email protected]>
1 parent 2e56fe5 commit eec2221

File tree

1 file changed

+3
-1
lines changed
  • packages/twenty-front/src/modules/object-record/record-board/record-board-card/components

1 file changed

+3
-1
lines changed

packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Checkbox, CheckboxVariant } from '@/ui/input/components/Checkbox';
2323
import { contextMenuIsOpenState } from '@/ui/navigation/context-menu/states/contextMenuIsOpenState';
2424
import { contextMenuPositionState } from '@/ui/navigation/context-menu/states/contextMenuPositionState';
2525
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
26+
import { useDragSelect } from '@/ui/utilities/drag-select/hooks/useDragSelect';
2627
import { ScrollWrapperContext } from '@/ui/utilities/scroll/components/ScrollWrapper';
2728

2829
const StyledBoardCard = styled.div<{ selected: boolean }>`
@@ -199,6 +200,7 @@ export const RecordBoardCard = () => {
199200
};
200201

201202
const scrollWrapperRef = useContext(ScrollWrapperContext);
203+
const { isDragSelectionStartEnabled } = useDragSelect();
202204

203205
const { ref: cardRef, inView } = useInView({
204206
root: scrollWrapperRef.current,
@@ -278,7 +280,7 @@ export const RecordBoardCard = () => {
278280
hotkeyScope: InlineCellHotkeyScope.InlineCell,
279281
}}
280282
>
281-
{inView ? (
283+
{inView || isDragSelectionStartEnabled() ? (
282284
<RecordInlineCell />
283285
) : (
284286
<StyledRecordInlineCellPlaceholder />

0 commit comments

Comments
 (0)