mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-18 18:59:15 +08:00
fix: cannot dnd in firefox
This commit is contained in:
parent
bf07610c43
commit
5af24c88d6
@ -140,10 +140,10 @@ function NewsCard({ id, setHandleRef }: NewsCardProps) {
|
||||
className={$("btn", isFocused ? "i-ph:star-fill" : "i-ph:star-duotone")}
|
||||
onClick={toggleFocus}
|
||||
/>
|
||||
{/* firefox cannot drag a button */}
|
||||
{setHandleRef && (
|
||||
<button
|
||||
<div
|
||||
ref={setHandleRef}
|
||||
type="button"
|
||||
className={$("btn", "i-ph:dots-six-vertical-duotone", "cursor-grab")}
|
||||
/>
|
||||
)}
|
||||
|
@ -37,10 +37,8 @@ export function useSortable(props: SortableProps) {
|
||||
if (handleRef && nodeRef) {
|
||||
const cleanup = combine(
|
||||
draggable({
|
||||
// use custom drag preview
|
||||
element: handleRef,
|
||||
// element: ref,
|
||||
// dragHandle: handleRef,
|
||||
element: nodeRef,
|
||||
dragHandle: handleRef,
|
||||
getInitialData: () => ({ id: props.id, instanceId }),
|
||||
onGenerateDragPreview({ nativeSetDragImage, location }) {
|
||||
setCustomNativeDragPreview({
|
||||
|
Loading…
x
Reference in New Issue
Block a user