jquery - Flex Parent Not Rearranging When A Flex Child Is Dragged Out -


i'm using css3 flex boxes , jquery ui drag , drop.

even though i've applied justify-content:space-around; if drag flex child , drop outside flex content, rest of items not rearranging in order honor justify-content property.

check jsfiddle

i want items re-arrange after item dragged out (rearrange flex-start , flex-end center or ever... want them flow once item removed)

how can fix this?

looks found issue myself after inspecting.

jquery ui changing position of element being dragged , dropped. stays inside it's parent after dropping droppable. hence looks the css flex items not rearranging...

the solution manually detach draggable , append droppable on drop event like

ui.draggable.detach().appendto($(this)); //where refers droppabe 

reference: append draggable droppable (so)


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -