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

Define sortable container explicitly #18

Closed
ghost opened this issue Apr 1, 2018 · 10 comments
Closed

Define sortable container explicitly #18

ghost opened this issue Apr 1, 2018 · 10 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Apr 1, 2018

Hi,
I have a problem while sorting. Dragged element disappears from view. It is inserted just before closing body tag. Is there a way to define sortable container?

@ghost
Copy link
Author

ghost commented Apr 1, 2018

@Jexordexan
I forked fiddle example : This is what i want exactly but i use this inside a modal. Then it can't find the container probably.
https://jsfiddle.net/atilkan/djbwn27o/10/

Note: I don't use name property for vue instance if it is relevant.

@ghost
Copy link
Author

ghost commented Apr 2, 2018

More info. Why contentWindow is undefined, i don't get it?
screen shot 2018-04-02 at 03 17 36

@ghost
Copy link
Author

ghost commented Apr 2, 2018

@Jexordexan I put examples side by side, not one setting is different. I only load vue staff in a modal dynamicly. I wish i could share it but it is bound to backend.

@Jexordexan
Copy link
Owner

I'm taking a look. But the contentWindow is an optional replacement for the window object, it should not really be used except in special circumstances.

You might want to make sure the helper elements z-index is greater than the modal's.

@Jexordexan Jexordexan added the question Further information is requested label Apr 2, 2018
@ghost
Copy link
Author

ghost commented Apr 2, 2018

I kind of dived into source but i don't understand why it could not find this.$el and defaults to window or document.
I don't know how to debug that.

@ghost
Copy link
Author

ghost commented Apr 2, 2018

@Jexordexan
To be clear; I insert this into html because i have other things in the same instance.

<sortable-list v-model="skills" v-bind:use-drag-handle="true">
			<sortable-item v-for="(item, index) in skills" v-bind:index="index" v-bind:key="index" v-bind:item="item" />
		</sortable-list>

And this is the html structure. sortableArea is the place. Vue instance have other things but not active yet.

screen shot 2018-04-02 at 04 44 06

@ghost
Copy link
Author

ghost commented Apr 2, 2018

@Jexordexan
I might be find it. Dragged element's css has fixed while dragging. I don't know where it comes from.
Edit: It comes from ContainerMixin.js
But it is not applied on your examples.

@ghost
Copy link
Author

ghost commented Apr 2, 2018

There might be something wrong here. ContainerMixin.js line 245
screen shot 2018-04-02 at 05 06 40

@ghost
Copy link
Author

ghost commented Apr 2, 2018

No, it is not it. Damn.

@ghost
Copy link
Author

ghost commented Apr 2, 2018

Well. I figured. I am really sorry about this. I took your time. It took my days to figure out.
I had several problems z-index was one of them. Thanks for pointing out.
Also i had other issue which is dragged item doesn't stick where i drag it. It was because of Vuex. I should learn a bit more about states and mutation.
Have a nice day.

@ghost ghost closed this as completed Apr 2, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant