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

Is it possible to change the selection area initial position? #210

Open
Polcsi opened this issue Sep 26, 2023 · 1 comment
Open

Is it possible to change the selection area initial position? #210

Polcsi opened this issue Sep 26, 2023 · 1 comment
Labels
feature request New feature requested

Comments

@Polcsi
Copy link

Polcsi commented Sep 26, 2023

Feature request or a solution for this issue! Currently there is no feature in the library for this issue or I could not find one. I hope there is an optimal solution for this problem.

Issue

I would like to change the area-selection initial position inside of onBeforeStart event handler.

Description about issue:

  1. When the user moves the mouse over one item then there will displayed a button at the bottom left corner.
    image
  2. User will be able to copy the current item properties to the newly selected items by selecting a range.
    image
  3. And I want to change the area-selection start position to the center of the item when user starts copying.
    image

Desired solution

This is how I imagine the solution for this issue:

const onBeforeStart = ({ event }: SelectionEvent) => {
        if (isCopy.current === true) {
           // Change area selection initial position
          // ...
        }

        // Preventing select from right click, middle mouse or left click
        return allowedButtons.current.includes(event.buttons);
    };
@simonwep
Copy link
Owner

That's a really cool idea, will definitely look into it :)

@simonwep simonwep added the feature request New feature requested label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature requested
Projects
None yet
Development

No branches or pull requests

2 participants