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