Opened 8 years ago

Last modified 6 years ago

#18001 new defect

dnd/Mover fails to position auto-wrapped inline elements on first move

Reported by: bicorn Owned by:
Priority: undecided Milestone: 1.15
Component: DnD Version: 1.9.3
Keywords: Cc:
Blocked By: Blocking:


When creating Moveables from inline (or inline-block) elements, the first Moveable after a line-wrap (on first move) is positioned before the line-wrap, that is after the end of previous line.

See minimal example below.

A simple fix is to set "position:absolute" AFTER obtaining margin box in Mover.js.

        var m = domGeom.getMarginBox(this.node);
        s.position = "absolute";  // enforcing the absolute mode

However I'm not sure if this agrees with rest of code. The tests in dojo/tests/dnd/ seem to work.

Minimal example:

<?xml version="1.1" encoding="utf-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xml:lang="de-DE" lang="de-DE" xmlns="">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
      html,body {
        margin: 0;
        border: 0;
        padding: 0;

      #dndArea, .dndItem {
        border: 1px solid black;
        padding: 10px;
        margin: 3px;

      #dndArea {
        position: relative;
        width: 30em;
        height: 20ex;
        background: yellow;
        overflow: hidden;

      .dndItem {
        /*display: inline-block;*/
        display: inline;
        background: red;


      var dojoConfig = {
        baseUrl: "/dev/tests/libs/dojo/dojo",
        async: true
      data-dojo-config="async: true">

        var poem = 
          "Wer reitet so spät durch Nacht und Stille , " +
          "es ist der Uli mit einer Mille ." ;

        var dndArea = dom.byId("dndArea");

        df.forEach( poem.split(/\s+/), function(word) {
          var div = domConstruct.create("div",{
            class: "dndItem", 
            innerHTML: word
, dndArea,"last");
" "), dndArea,"last");
          new Moveable(div);



    <div id="dndArea"></div>


Attachments (1)

MoverBug.html (2.0 KB) - added by bicorn 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by bicorn

Attachment: MoverBug.html added

comment:1 Changed 7 years ago by dylan

Milestone: tbd1.12

comment:2 Changed 6 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.