Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5064

setDraggable with true twice, the state will be leaking

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      1. Run the following code
      <zk xmlns:w="client">
          <label multiline="true">
           1. click "set Draggable to true" twice
           2. click "set Draggable to false" twice or more times
           3. Try to drag the blue div, it should not be draggable.
          </label>
          <div id="draggable" style="border: 1px solid blue">Welcome to ZK Fiddle , run it right now!</div>
      
          <button id="btn1" label="set Draggable to true" w:onClick='zk.$("$draggable").setDraggable(true)'/>
          <button id="btn2" label="set Draggable to false" w:onClick='zk.$("$draggable").setDraggable(false)'/>
      </zk>
      1. click "set Draggable to true" twice
      2. click "set Draggable to false" twice or more time

      Current Result

      The blue div can be still draggable

      Expected Result

      The blue div cannot be draggable

      Debug Information

      Widget.setDraggable(true) will add the draggable handle each time it invoking, and remove only for the first time invoking setDraggable(false), so others draggable handlers are leaking.

            Unassigned Unassigned
            jumperchen jumperchen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: