Moveable: [New Plugin] Click Drag to select for Moveable ❤❤❤

Created on 8 Jan 2020  ·  7Comments  ·  Source: daybrush/moveable

Hi all,
I've made an app with react-moveable, the click drag to select is like this demo:
ezgif com-crop
If you need this feature, please comment bellow this, I'll to publish it if much people need this.

Feature enhancement question

Most helpful comment

@ladifire
Jan-08-2020 18-00-54

I am making a component called selecto and will probably be released this month.

Of course, React, Angular, Vue, Svelte, Preact, Lit will be supported.

Thank you :)

It will probably be supported in the example:

import Selecto from "react-selecto";

<Selecto
    ref={selectoRef}
    dragContainer={document.body}
    keyContainer={window}
    selectFromInside={false}
    selectByClick={true}
    selectableTargets={[".target"]}
    toggleContinueSelect="shift"
    hitRate={0}
    onDragStart={(e: any) => {
        if (moveableRef.current?.isMoveableElement(e.inputEvent.target)) {
            return false;
        }
        return;
    }}
    onSelectEnd={e => {
        setTimeout(() => {
            setTargets(e.selected);

            if (e.isDragStart) {
                e.inputEvent.preventDefault();
            }
        });
    }}
    />
<Moveable
    ref={moveableRef}
    target={targets}
    draggable={true}
    onClickGroup={e => {
        selectoRef.current!.click(e.inputEvent, e.inputTarget);
    }}
     />

All 7 comments

@ladifire
Jan-08-2020 18-00-54

I am making a component called selecto and will probably be released this month.

Of course, React, Angular, Vue, Svelte, Preact, Lit will be supported.

Thank you :)

It will probably be supported in the example:

import Selecto from "react-selecto";

<Selecto
    ref={selectoRef}
    dragContainer={document.body}
    keyContainer={window}
    selectFromInside={false}
    selectByClick={true}
    selectableTargets={[".target"]}
    toggleContinueSelect="shift"
    hitRate={0}
    onDragStart={(e: any) => {
        if (moveableRef.current?.isMoveableElement(e.inputEvent.target)) {
            return false;
        }
        return;
    }}
    onSelectEnd={e => {
        setTimeout(() => {
            setTargets(e.selected);

            if (e.isDragStart) {
                e.inputEvent.preventDefault();
            }
        });
    }}
    />
<Moveable
    ref={moveableRef}
    target={targets}
    draggable={true}
    onClickGroup={e => {
        selectoRef.current!.click(e.inputEvent, e.inputTarget);
    }}
     />

This feature is great, hope it release soon!

@daybrush are you planning to release this? The storybook looks great! (https://daybrush.com/selecto/storybook/?path=/story/selecto-with-moveable--you-can-change-the-moveable-target-in-real-time-by-selecting-it) I can also get it from npm I saw, but the github repo is unavailable (not public?).

@happylinks
not yet ? Soon?

I am so busy these days that I have no time to work.

Ahh that's alright, thanks for the response!
Would you consider making the github repo available already? Or are you not comfortable with that yet?
If not I understand, no worries :)
Take care!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scottsquirespix picture scottsquirespix  ·  5Comments

jameschetwood picture jameschetwood  ·  6Comments

MiiZZo picture MiiZZo  ·  3Comments

tesmem101 picture tesmem101  ·  3Comments

ladifire picture ladifire  ·  3Comments