-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!(core & api): rename drag events for better consistency and clarity #10170
Conversation
tooling/api/src/webview.ts
Outdated
const unlistenDrop = await this.listen<DragDropPayload>( | ||
TauriEvent.DROP, | ||
const unlistenDragOver = await this.listen<DragPayload>( | ||
TauriEvent.DRAG_LEAVE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This listener should be attached to TauriEvent.DRAG_OVER
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, thanks
- `TauriEvent.DRAG` -> `TauriEvent.DRAG_ENTER` | ||
- `TauriEvent.DROP_OVER` -> `TauriEvent.DRAG_OVER` | ||
- `TauriEvent.DROP` -> `TauriEvent.DRAG_DROP` | ||
- `TauriEvent.DROP_CANCELLED` -> `TauriEvent::DRAG_LEAVE` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'drag leave' makes sense on the JS world because you must define which elements receive the event; in our case 'leave' is misleading because it's not triggered when the drag operation moves out of the window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be triggered, if not, that's a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oohhh i didn't know we changed that on wry, let me check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works indeed, but now i miss the old https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragend_event from https://docs.rs/wry/0.29.0/wry/webview/enum.FileDropEvent.html#variant.Cancelled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't differentiate between cancelled and leave so we combined them, not sure what's the best name here
Package Changes Through 4b39f1bThere are 9 changes which include tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri with prerelease, @tauri-apps/api with prerelease, tauri-bundler with prerelease, tauri-macros with prerelease, tauri-codegen with prerelease, tauri-runtime-wry with prerelease, tauri-utils with prerelease Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
No description provided.