Skip to content

Commit

Permalink
Fixed: Fields Disappear on Drag and Drop (#5703)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
shashankvish0010 and martmull authored Jun 3, 2024
1 parent e49db63 commit a6b8bee
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }>`
Expand Down Expand Up @@ -199,6 +200,7 @@ export const RecordBoardCard = () => {
};

const scrollWrapperRef = useContext(ScrollWrapperContext);
const { isDragSelectionStartEnabled } = useDragSelect();

const { ref: cardRef, inView } = useInView({
root: scrollWrapperRef.current,
Expand Down Expand Up @@ -278,7 +280,7 @@ export const RecordBoardCard = () => {
hotkeyScope: InlineCellHotkeyScope.InlineCell,
}}
>
{inView ? (
{inView || isDragSelectionStartEnabled() ? (
<RecordInlineCell />
) : (
<StyledRecordInlineCellPlaceholder />
Expand Down

0 comments on commit a6b8bee

Please sign in to comment.