selection icon indicating copy to clipboard operation
selection copied to clipboard

Is it possible to change the selection area initial position?

Open Polcsi opened this issue 2 years ago • 1 comments

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);
    };

Polcsi avatar Sep 26 '23 11:09 Polcsi

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

simonwep avatar Sep 27 '23 06:09 simonwep