Skip to content

The screenX and screenY of the drag event in the webview are wrong #177

Open
@zhu-xiaoming

Description

@zhu-xiaoming

I listened to the drag event, in the dragend event, I got screenX and screenY, and found that their values ​​are wrong.

Here is a minimal reproducible example, which is a repository generated using skpm/with-webview template:
https://github.com/little-tomorrow/sketch-plugin-test

Version Information

  • sketch version: 72.1
  • macos version: 11.3.1

To reproduce

  1. git clone https://github.com/little-tomorrow/sketch-plugin-test.git
  2. Run npm i to generate the my-plugin plugin in the project
  3. Start sketch, select plugin -> my-plugin -> my-command, At this time, the webview window will be opened
  4. Drag the github picture in the webview to the upper left corner of the screen
  5. Then open devtools through the right-click menu

Expected Behavior

Print out x: 0, y: 0 in devtools

Actual Behavior

Print out x: 123, y: 66 in devtools

Screenshots

image
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions