Hacker News new | past | comments | ask | show | jobs | submit login

Spent half the morning trying to work out why drag and drop events were not working properly in code that was working fine and deployed for nearly a year. Finally tracked it down to this obscure bug in Chrome 77 which re-orders drag and drop events but only when your page is inside an iframe that is hosted on a different ___domain. Looking at the report it looks like this has broken a lot of peoples applications and likely a lot more that haven't yet worked out this is the reason. Looks like a fix is coming in 78 fortunately.



I work on drag & drop a lot, especially right now. It's interesting how complicated overall, and how many different (code) solutions there are to the general drag & drop UX problem. I was consolidating ideas/notes from older notebooks a few mornings ago, I couldn't help thinking how it feels like reimplementing human evolution in a different/abstract medium.


Agreed, it's a much harder problem to get right than it looks on the surface "sure I can add drag & drop easily!". Like a lot of things in software...


To me it's very interesting to see how many applications completely forgot that you might want to use a scroll wheel during a drag and drop. I don't think that even works half the time...


Yeah, I can attest to this. It sounds easy at first, but suddenly you need to handle items inside virtual lists (e.g., react-window), scrolling, data updating while dragging, ...


You can add drag and drop quite easily if you use a library for it.


That’s exactly what you think going in...that’s the point I’m making.

No one is hand rolling drag and drop these days.

There’s a lot of complexity implementing drag and drop both visually and binding stuff to events. It’s messy and finicky. Unless your usecase is very simple.


To add to sibling's point, many drag-drop libraries work great on a bare demo website with nothing else to worry about.

Once you start trying to add it to your frontend with other complex features already there, you're back having to reason about the core of drag-and-drop and essentially solving it yourself to parse the library's code. In my experience I've had to modify library code to handle my requirements most of the time because it did not play well in a complex environment.


https://bugs.chromium.org/p/chromium/issues/detail?id=410328...

I've been tracking this drag-and-drop bug from five years ago; it's still not fixed.

I think most browser manufacturers mostly gave up on the HTML5 drag-and-drop API. There are lots of open bugs on lots of browsers that haven't been touched in ages.


Well that makes me feel better AND worse about the one I filed a year and a half ago. (Drag events aren't dispatched at all on option elements in a multi-select, which is such a shame because a multi-select seems like the best native form UI for users to create orderings & permutations...)


The fix is in 77.0.3865.120 (see comments 45, 46), if you update to current stable it should be fine.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: