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

Add a hook to create dragable elements #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexfauquette
Copy link

@alexfauquette alexfauquette commented May 6, 2023

Fix #120

It introduces useDragElement which simplifies the creation of a draggable component that can be controlled or not:

Two main ways to use them are:

  • provide initialPoint and onMove to get updates on the point position
  • provide point and onMove to control the position

The switch between controlled and uncontrolled behavior is a copy past from @mui codebase

Demo here

Still to do:

  • Udpate the demo such that the focus and hover are visible
  • Document a11y to introduce tab sequence and keyboard interaction

@vercel
Copy link

vercel bot commented May 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mafs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2023 0:37am

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

Successfully merging this pull request may close these issues.

Allows to render custom dragable Elements
1 participant