0

I have problems to set elements draggable using jQueryUI 1.12.1. There is no problem, when draggable element is <div>, but when I switched it to the <input ... >, it does not move from place. I tried to disable element too in order to make it more "stiff", but it makes no difference.
The similarly pitiful outcomes I had with resizing <label> for <input>. I could move it on the screen, but I was unable to resize it.

Here is code I just copied from the page and made minor changes:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>resizable demo</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
  <style>
  #brick {
    width: 100px;
    height: 100px;
    background: #ccc;
}   </style>
  <script src="http://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>

    <label id="brickLabel" for="brick">Brick is stiff</label>
    <input type='text' id="brick" disabled/>
    <div id="goodBrick" style="width: 100px; height: 70px; background-color: #EF45fE"></div>

<script>
$( "#goodBrick" ).draggable();
$( "#goodBrick" ).resizable();    
$( "#brick" ).draggable();
$( "#brick" ).resizable();
$( "#brickLabel" ).draggable();
$( "#brickLabel" ).resizable();
</script>

</body>
</html>

So where I do mistake?

lyborko
  • 2,571
  • 3
  • 26
  • 54
  • Click events do not fire on disabled elements: http://stackoverflow.com/questions/3100319/event-on-a-disabled-input – Twisty Apr 19 '17 at 16:35
  • Outside of using a handle or `.stopPropagation()` to unbind the click event that is part of the element, you could work around it some: https://jsfiddle.net/Twisty/e59novst/4/ – Twisty Apr 19 '17 at 17:10

0 Answers0