Skip to content
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

Get dragging piece element #178

Open
sbeben opened this issue Jan 2, 2025 · 2 comments
Open

Get dragging piece element #178

sbeben opened this issue Jan 2, 2025 · 2 comments

Comments

@sbeben
Copy link

sbeben commented Jan 2, 2025

I need to make the dragging piece bigger, and transform it slightly, because on touch devices it's hidden under the finger.

Dragging element does not have any id or data-attribute, so there's no direct way to catch it with querySelector. Also, onDragStart seems to be fired before the element mounts.

Am i missing something?

@sbeben
Copy link
Author

sbeben commented Jan 9, 2025

Hello, @Clariity
would be happy to her your comment on that

@sbeben
Copy link
Author

sbeben commented Jan 14, 2025

for me seems reasonable to add

customDraggingPieceStyle?: Record<string, string | number>

and just land it into CustomDragLayer.tsx like so

  <svg 
     viewBox={"1 1 43 43"} 
     width={boardWidth / 8} 
     height={boardWidth / 8} 
     style={customDraggingPieceStyle}>
            <g>{chessPieces[item.piece] as ReactNode}</g>
   </svg>     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant