-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No .contextmenu() event callback implemented yet #1217
Comments
Feel free to create PR for that :) |
I am sorry, I somehow forgot to publish all the fixes I made. I just released it: |
@Fuzzyma Sorry to annoy again. While .contextmenu() is now available, all drag and drop events like "dragover", "drop", etc. do not exist yet. According to https://www.w3.org/TR/SVG2/attindex.html#RegularAttributes, drag and drop should be supported. |
It is a mystery to me how people still use the shorthands instead of just using svg.js/src/modules/optional/sugar.js Line 163 in ec9d2fc
|
@Fuzzyma The reason I prefer the shorthand methods is that when using TS, you get more precise types and don't have to add unnecessary type guards. Example:
`function onDragOver(event: Event, row: GanttRow, api: GanttApi): void {
}` Your |
ah i see, maybe we can change the on-typings to be generic |
@Fuzzyma That would be even better! I agree that using the generic |
Sorry for the late reply, will check out by end of the week and report back. Thank you for your efforts! :) |
I have searched through both the documentation and the codebase. In neither, there is any result for 'contextmenu'. It's simply missing from the list of supported events (https://svgjs.dev/docs/3.1/events/). Yes, you could differentiate that from the regular
.click()
callback, but since you support all other events, this one should be supported as well? Or am i missing something?So instead of:
one could write:
The text was updated successfully, but these errors were encountered: