Home › Forums › Bug Reports › Drag and drop in gallery field extremely hard to use
Using the latest version of ACF Pro, though probably applies to all versions.
There are two issues with the drag and drop functionality in the gallery field which make it almost impossible to use. Consider this collection of logos:
I move my mouse to the ‘Sandia National Laboratories’ logo, click, and start dragging. The following happens (location of mouse cursor added):
The logo I’m dragging appears a long way from the cursor (and continues to stay at that offset). Somehow a scrollbar has appeared, which means less room for the logos, which means the placeholder doesn’t fit where it used to, which means the logos wrap onto a third row, which means a scrollbar appears. I’m not sure where that circle of logic starts, but there’s a bug there somewhere!
Secondly, I want to drag the GE logo over a couple of spots. Mouse cursor shows where I’m dragging it to:
But it hasn’t allowed me to – it only updates the position if my mouse cursor is higher, exactly over the very short image that is sitting in that position. When small images are involved, this is very awkward (and it took me a while to figure out that was why it wouldn’t drop in position). Ideally, the ‘droppable’ area should expand in height to match the largest image in that row.
It’s not the appearance of the scroll bar doing it. The containing div has a padding on which is somehow affecting the width of the placeholder div that’s put in place when you start dragging one of the images, honestly I’m not sure why.
I will mark this topic for the developer to look at when he has time.
In the meantime, adding this to functions php will fix the issue
add_action('admin_head', 'correct_acf_gallery_drag');
function correct_acf_gallery_drag() {
?>
<style>
.acf-gallery-attachments {
padding: 0;
}
</style>
<?php
}
That doesn’t seem to have helped I’m afraid. Seems dragging any item causes something to shift onto the next row.
It’s because of the way:
.acf-gallery-attachment:nth-child(5n+1)
is set to clear:left
– when I start dragging, an extra element gets added, so the wrong one gets cleared.
I’m not sure exactly what’s going on. I’ve marked this for the developer’s attention but I can’t say when he’ll see it. If you want quicker attention then you should submit support ticket here http://support.advancedcustomfields.com/new-ticket/.
It’s been a while but I never heard anything back from the support ticket. Every time I want a group of images I’m having to use a repeater field since drag and drop in the gallery is broken – any chance in bumping this up the priority list?
I’ve marked this thread as a bug, which is really as far as I can go. I’m not part of the support staff, so I can’t tell you where that stands.
So does nobody actually use the gallery field in reality? This major bug makes it far too hard for any of our clients to use, so I have to avoid it and use a repeater field every time..
Hi guys
Thanks for your help bringing this bug to light.
I’ve done some work improving the gallery field.
Please login to your account online and click the ‘see all versions’ link next to your license. This will allow you to see and download version 5.4.0 beta3. http://www.advancedcustomfields.com/my-account
I have been able to completely fix this drag/drop float/clear issue by improving the UI. I have removed the ‘preview_size’ setting and rendered the UI more similar to how WP does in it’s media library.
I’ve wanted to do this for a while and am happy with the results.
What do you think?
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re hard at work on ACF 6.1, and Beta 1 is now available 🚀
— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.