014.html (1083B)
1 <!DOCTYPE html> 2 <title>drag & drop - drop interrupted by alert must not break mouse interaction with UI</title> 3 <style> 4 body > div { 5 height: 200px; 6 width: 200px; 7 background-color: orange; 8 } 9 body > div + div { 10 margin-top: 10px; 11 height: 200px; 12 width: 200px; 13 background-color: blue; 14 } 15 </style> 16 17 <script> 18 window.onload = function() { 19 var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1]; 20 orange.ondragstart = function(e) { 21 e.dataTransfer.effectAllowed = 'copy'; 22 e.dataTransfer.setData('text', 'dummy text'); 23 }; 24 blue.ondragover = blue.ondragenter = function(e) { 25 e.preventDefault(); 26 e.dataTransfer.dropEffect = 'copy'; 27 }; 28 blue.ondrop = function(e) { 29 e.preventDefault(); 30 alert('It should ideally be possible to dismiss this dialog with your mouse/pointing device (do not use mouse gestures).'); 31 }; 32 }; 33 </script> 34 35 <p>Drag the orange square onto the blue square.</p> 36 <div draggable="true"></div> 37 <div></div> 38 39 <noscript><p>Enable JavaScript and reload</p></noscript>