Skip to content

Commit

Permalink
Merge pull request #148 from urLink-DEV/hotfix/first-category-drag-drop
Browse files Browse the repository at this point in the history
FirstCategory, FirstFavorite 드롭존에 드래그 드랍 안되던 이슈 해결
  • Loading branch information
yjkwon07 authored Jun 6, 2021
2 parents d7240e7 + e502dad commit 7fa664d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/pages/Home/CategoryList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,33 @@ function CategoryList() {
e.stopPropagation()
e.preventDefault()
if (dragType === CATEGORY && !dragData.is_favorited) {
setDragData({
...dragData,
setDragOverTabData({
...dragOverTabData,
id: dragData.id,
name: dragData.name,
order: 1,
is_favorited: true,
})
}
},
[dragData, dragType, setDragData]
[dragData, dragType, dragOverTabData, setDragOverTabData]
)

const handleDragOverFirstCategory = useCallback(
(e) => {
e.stopPropagation()
e.preventDefault()
if (dragType === CATEGORY && dragData.is_favorited) {
setDragData({
...dragData,
setDragOverTabData({
...dragOverTabData,
id: dragData.id,
name: dragData.name,
order: 1,
is_favorited: false,
})
}
},
[dragData, dragType, setDragData]
[dragData, dragType, dragOverTabData, setDragOverTabData]
)

const handleDragStart = useCallback(
Expand Down

0 comments on commit 7fa664d

Please sign in to comment.