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

feat: disable boundaries check #173

Closed
fmilioni opened this issue Feb 23, 2021 · 0 comments
Closed

feat: disable boundaries check #173

fmilioni opened this issue Feb 23, 2021 · 0 comments

Comments

@fmilioni
Copy link
Contributor

fmilioni commented Feb 23, 2021

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Menu position is changed if outside screen when using a custom position

What is the expected behavior?
Do not update menu position if I pass a prop to disable this feature

Why I need this
I have a custom positioning that depends on current translation of my object. The position is not outside screen, but its greater than the innerWidth.

  function handleMenu(id: string, event: any) {
    event.preventDefault();

    const pos = getMousePosition(event);
    const { x, y, scale } = getTransform('react-transform-element');

    show(event, {
      id,
      position: {
        x: (pos.x - x + 10) / scale,
        y: (pos.y - y + 10) / scale,
      },
    });
  }

Demo

Feb-23-2021.18-08-44.mp4

Note: if I press twice, the position works, but its a bug related to this issue: #163

@fkhadra fkhadra added this to the v6.0.0 milestone Nov 3, 2022
@fkhadra fkhadra changed the title Prop to allow menu to be "outside" screen width and height feat: disable boundaries check Nov 3, 2022
@fkhadra fkhadra closed this as completed Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants