0 Replies Latest reply on Mar 31, 2009 2:48 PM by 5barns

    dragstart from HTML control doesn't set event.shiftKey properly

    5barns Level 1
      When initiating a drag from an HTML control, the value of event.shiftKey is always false.

      Here's an HTML page that runs properly in webkit.

      <html>
      <head>
      <script>
      function trace (ev) {
      document.getElementById('traceLog').innerHTML += ev.type + ': shiftKey: ' + ev.shiftKey + '<br/>'
      }
      </script>
      </head>
      <body>
      <div id='dragMe'
      style='cursor:move; border:1px solid black; padding:5px; -webkit-user-drag:element; -webkit-user-select:none'
      ondragstart='trace(event)'
      onclick='trace(event)'
      ondragend='trace(event)'
      >
      Initiate a Drag (while holding down the shift-key)
      </div>
      <div id='traceLog'></div>
      </body>
      </html>

      While holding down the shift key, initiate a drag from some whitespace within the top bordered DIV and you'll get a trace that includes:

      dragstart: shiftKey: true.

      Do the same thing while running this in AIR (I'll include the shift-app.xml below), and the trace will include:

      dragstart: shiftKey: false.

      Is this a bug? Or is there some spec that might shed light on the different semantics?

      Here's the shift-app.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns=" http://ns.adobe.com/air/application/1.5">
      <id>shift</id>
      <version>shift</version>
      <filename>shift</filename>
      <name>shift</name>

      <initialWindow>
      <title>shift</title>
      <content>shift.html</content>
      <systemChrome>standard</systemChrome>
      <transparent>false</transparent>
      <visible>true</visible>
      <minimizable>false</minimizable>
      <maximizable>false</maximizable>
      <resizable>true</resizable>
      </initialWindow>

      </application>