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

How to disable 'Drag' on child element #60

Closed
samyfox opened this issue May 23, 2017 · 2 comments
Closed

How to disable 'Drag' on child element #60

samyfox opened this issue May 23, 2017 · 2 comments

Comments

@samyfox
Copy link

samyfox commented May 23, 2017

I would like to use the drag option but not on all the .vue-grid-item element.
How to disable inside a child element ?

With an iframe or a button inside a .vue-grid-item element, it's not dragable, this is the behavior that I want with a textarea.

@harshalkhandare
Copy link

harshalkhandare commented May 23, 2017

You can use the 'dragIgnoreFrom' prop on Grid Item to achieve this.
Specify the child element names to disable drag from in the comma-separated string for the prop.
Defaults to: "a, button"

<grid-item v-for="item in layout"
                           :x="item.x"
                           :y="item.y"
                           :w="item.w"
                           :h="item.h"
                           dragIgnoreFrom="a, button, textarea"
                           :i="item.i">
                    {{item.i}}
        </grid-item>

@samyfox
Copy link
Author

samyfox commented May 24, 2017

Thanks, it works.
I can also specify a class or an id in the dragIgnoreFrom prop, nice !

@samyfox samyfox closed this as completed May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants