-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[swapello] fix card unable to drag issue #2173
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useState, useEffect } from 'react' | ||
import { Droppable as RBDDroppable } from 'react-beautiful-dnd' | ||
|
||
|
||
export const Droppable = ({ children, ...props }) => { | ||
const [enabled, setEnabled] = useState(false); | ||
useEffect(() => { | ||
const animation = requestAnimationFrame(() => setEnabled(true)); | ||
return () => { | ||
cancelAnimationFrame(animation); | ||
setEnabled(false); | ||
}; | ||
}, []); | ||
if (!enabled) { | ||
return null; | ||
} | ||
return <RBDDroppable {...props}>{children}</RBDDroppable>; | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ import React, { useState, useRef, useContext } from 'react' | |
import { Plus, X, MoreHorizontal } from 'react-feather' | ||
import { Popover } from 'react-tiny-popover' | ||
import classnames from 'classnames' | ||
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd' | ||
|
||
import { DragDropContext, Draggable } from 'react-beautiful-dnd' | ||
import { Droppable } from './Drappable' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you rename the file from |
||
import UserPageLayout from './UserPageLayout' | ||
|
||
import './Main.css' | ||
|
@@ -243,7 +243,7 @@ const List = ({ list, index, cards }) => { | |
index={index} | ||
> | ||
{(provided, snapshot) => ( | ||
<div className='list-wrapper' | ||
<div className={`list-wrapper`} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you pls revert this change since it doesn't do anything and it's not what you'd usually write for a React component static |
||
ref={provided.innerRef} | ||
{...provided.draggableProps} | ||
{...provided.dragHandleProps} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you auto format this file?
It's missing a new line at the end and the indentation feels off.