タグ D&D 時の表示位置修正 (#268) #400
@@ -65,7 +65,7 @@ const DraggableDroppableTagRow: FC<Props> = ({ tag, nestLevel, pathKey, parentTa
|
|||||||
data: { kind: 'tag', tagId: tag.id } })
|
data: { kind: 'tag', tagId: tag.id } })
|
||||||
|
|
||||||
const style: CSSProperties = { transform: CSS.Translate.toString (transform),
|
const style: CSSProperties = { transform: CSS.Translate.toString (transform),
|
||||||
visibility: dragging && !(sp) ? 'hidden' : 'visible' }
|
visibility: dragging ? 'hidden' : 'visible' }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { DndContext,
|
|||||||
MouseSensor,
|
MouseSensor,
|
||||||
TouchSensor,
|
TouchSensor,
|
||||||
pointerWithin,
|
pointerWithin,
|
||||||
rectIntersection,
|
|
||||||
useDroppable,
|
useDroppable,
|
||||||
useSensor,
|
useSensor,
|
||||||
useSensors } from '@dnd-kit/core'
|
useSensors } from '@dnd-kit/core'
|
||||||
@@ -36,8 +35,7 @@ import type { Category, Post, TagWithSections } from '@/types'
|
|||||||
type TagByCategory = { [key in Category]: TagWithSections[] }
|
type TagByCategory = { [key in Category]: TagWithSections[] }
|
||||||
|
|
||||||
const tagCollisionDetection: CollisionDetection = args => {
|
const tagCollisionDetection: CollisionDetection = args => {
|
||||||
const byPointer = pointerWithin (args)
|
return pointerWithin (args)
|
||||||
return byPointer.length > 0 ? byPointer : rectIntersection (args)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const alwaysMeasureDroppables = {
|
const alwaysMeasureDroppables = {
|
||||||
@@ -491,7 +489,6 @@ const TagDetailSidebar: FC<Props> = ({ className, post, sp }) => {
|
|||||||
</ul>
|
</ul>
|
||||||
</motion.div>)}
|
</motion.div>)}
|
||||||
|
|
||||||
{!(sp) && (
|
|
||||||
<DragOverlay adjustScale={false}>
|
<DragOverlay adjustScale={false}>
|
||||||
<div className="pointer-events-none">
|
<div className="pointer-events-none">
|
||||||
{activeTagDrag != null && (() => {
|
{activeTagDrag != null && (() => {
|
||||||
@@ -499,7 +496,7 @@ const TagDetailSidebar: FC<Props> = ({ className, post, sp }) => {
|
|||||||
return tag && <TagLink tag={tag} nestLevel={activeTagDrag.nestLevel}/>
|
return tag && <TagLink tag={tag} nestLevel={activeTagDrag.nestLevel}/>
|
||||||
}) ()}
|
}) ()}
|
||||||
</div>
|
</div>
|
||||||
</DragOverlay>)}
|
</DragOverlay>
|
||||||
</DndContext>
|
</DndContext>
|
||||||
</SidebarComponent>)
|
</SidebarComponent>)
|
||||||
}
|
}
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする