daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Any native input elements are not supported inside movable wrapper #665

Open koppreshk opened 2 years ago

koppreshk commented 2 years ago

Environments

Description

daybrush commented 2 years ago

@koppreshk Please tell me the framework and version name. I recently made a related patch, please update it

Soya-xy commented 2 years ago

@koppreshk请告诉我框架和版本名称。我最近做了一个相关的补丁,请更新

"svelte-moveable": "^0.22.1-beta.0",

vite 2.9.12
this same issue

daybrush commented 2 years ago

@Soya-xy @koppreshk

Do you mean that it would be desirable to operate as a target of the input Moveable?

https://codesandbox.io/s/magical-mountain-6r5ebf?file=/App.svelte

If draggable is true, it is dragged.

Soya-xy commented 2 years ago

yes it can dragged, but can`t input.

Soya-xy commented 2 years ago

I want input to be input when focus is triggered, or input to be input directly

Soya-xy commented 2 years ago

Hello, is there any progress on this issue? i want can input or select when dragging

daybrush commented 2 years ago

@Soya-xy

Use checkInput prop (true).

daybrush commented 2 years ago

@Soya-xy

The select element is not yet a target, but input, textarea, and contenteditable are applicable.

daybrush commented 2 years ago

@Soya-xy

moveable's new version is released. Use stopDrag event property function

 <Moveable
            target={".target2"}
            draggable={true}
            onDragStart={e => {
                if (["input", "select"].indexOf(e.target.tagName.toLowerCase()) > -1) {
                    e.stopDrag();
                }
            }}
            onDrag={e => {
                e.target.style.cssText += e.cssText;
            }}
        />
Soya-xy commented 2 years ago

Thanks!!! I'll give it a try

DongFang-Jun commented 1 year ago

How to solve the problem in vue version

DongFang-Jun commented 1 year ago

@Soya-xy

moveable's new version is released. Use stopDrag event property function

 <Moveable
            target={".target2"}
            draggable={true}
            onDragStart={e => {
                if (["input", "select"].indexOf(e.target.tagName.toLowerCase()) > -1) {
                    e.stopDrag();
                }
            }}
            onDrag={e => {
                e.target.style.cssText += e.cssText;
            }}
        />

This doesn't work after I apply to vue version, my vue version is 2.0.0-beta.55

daybrush commented 1 year ago

@vivoX9

See the Vue code panel

https://daybrush.com/moveable/storybook2/?path=/story/variable-situations--stop-drag-if-target-is-select-input-textarea