[Webkit-unassigned] [Bug 202418] New: MouseEvent altKey property only changes on dragStart

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 1 12:03:54 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=202418

            Bug ID: 202418
           Summary: MouseEvent altKey property only changes on dragStart
           Product: WebKit
           Version: Other
          Hardware: Macintosh
                OS: macOS 10.14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: UI Events
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jay at conton.io

Created attachment 379924

  --> https://bugs.webkit.org/attachment.cgi?id=379924&action=review

Screen recording of problem

Safari Version 13.0.1
macOS Version 10.14.6 (18G95)

While dragging a draggable element, `event.altKey` should change to true/false depending if I hold the option key on my Mac.

In Firefox, I can start a drag, and then toggle the option key to see the altKey value change from false to true. I do not need to have the option key pressed before I start dragging.

In Safari, I have to start the drag operation with option already held down in order for the MouseEvent's altKey property to be true. If I let go of the option key, the altKey value never changes. 

In Safari, if I start a drag event without holding the option key down, the MouseEvent's altKey property will never change. 

Here is a video logging out the value of altKey as I dragEnter and dragOver the items on the left. 

The item I am dragging has the following in its dragStart handler

```
e.dataTransfer.effectAllowed = 'copyMove'
e.dataTransfer.dropEffect = 'move'
```

the item I am dropping on has the following events. e.altKey will *always* be false in webkit if I don't start the drag operation with option held down. It will *always* be true if I start the drag operation with option held down.

```
function dropHandler(e) {
  e.preventDefault()
  e.dataTransfer.effectAllowed = 'copyMove'
  ...
  // If we're copying
  if (e.altKey) {
    fieldCopyHandler(oldDocumentId, thisDocumentId, fieldId)
  } else {
    fieldMoveHandler(oldDocumentId, thisDocumentId, fieldId)
  }
}

function dragEnterHandler(e) {
  console.log(e.altKey)
}

function dragOverHandler(e) {
  console.log(e.altKey)
}
```

I have attached a video

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191001/a82ad297/attachment.html>


More information about the webkit-unassigned mailing list