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

[BUG]: drag axis doesn't work properly #969

Open
mohiwalla opened this issue Mar 1, 2025 · 1 comment
Open

[BUG]: drag axis doesn't work properly #969

mohiwalla opened this issue Mar 1, 2025 · 1 comment

Comments

@mohiwalla
Copy link

What is happening?

I'm able to drag element in the non-allowed direction after mouseup event.
Dragging is only allowed for X axis in this example on story book, it works but only until mouse key is not lifted up.
Check this video.

Screencast_20250301_081510.webm

How to reproduce?

  1. Go to this page.
  2. Try dragging the element in non-allowed direction.
  3. Lift mouse key up after dragging.
  4. It should get dragged to other axis as well.

What should be happening?

As per the docs, it should only be draggable in one direction.

Image

System details
OS: Arch Linux, KDE plasma
Browser: Chrome, Firefox
Code sample: https://github.com/bokuweb/react-rnd/blob/master/stories/dragAxis/dragAxisX.tsx
@mohiwalla
Copy link
Author

mohiwalla commented Mar 1, 2025

Tried this example locally, working even weird.

import { Rnd } from "react-rnd"

export default function Page() {
  return (
    <Rnd
      style={{ border: "thin solid black" }}
      default={{ x: 0, y: 0, width: 200, height: 200 }}
      dragAxis="x"
    >
      001
    </Rnd>
  )
}

Instead of being dragged immediately to non-allowed axis, it shows on original posistion until you start resizing.

Screencast_20250301_084227.webm

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