-
-
Notifications
You must be signed in to change notification settings - Fork 800
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
Change the onClick event to handle both mouseUp and mouseDown #4982
Comments
I would like to work on this |
Sure, I haven't started yet on this |
⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.
Actions (click)
Step 1: 🔎 SearchingI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.tsparticles/engine/src/Options/Classes/Interactivity/Events/Events.ts Lines 1 to 101 in 21c7989
tsparticles/engine/src/Core/Utils/EventListeners.ts Lines 86 to 177 in 21c7989
tsparticles/interactions/external/bubble/src/Bubbler.ts Lines 61 to 149 in 21c7989
tsparticles/markdown/Options/FullScreen.md Lines 1 to 16 in 21c7989
Step 2: ⌨️ Coding
• Add new properties `onMouseDown` and `onMouseUp` of type `ClickEvent`. • Initialize these properties in the constructor. • Add new getters and setters for these properties. • Update the `load` method to load these new properties from the provided data.
• Update the `_handlers` object to include new handlers for `mousedown` and `mouseup` events. • Update the `_doMouseTouchClick` method to handle these new events.
• Update the `interact` method to use the new `onMouseDown` and `onMouseUp` events.
• Add new properties `onMouseDown` and `onMouseUp` of type `SingleOrMultiple`. • Initialize these properties in the constructor. • Add new getters and setters for these properties. • Update the `load` method to load these new properties from the provided data.
• Add new properties `onMouseDown` and `onMouseUp` of type `IClickEvent`.
• Add new properties `onMouseDown` and `onMouseUp` of type `SingleOrMultiple`.
• Add new properties `onMouseDown` and `onMouseUp` of type `SingleOrMultiple`. • Initialize these properties in the constructor. • Add new getters and setters for these properties. • Update the `load` method to load these new properties from the provided data.
• Document the new `onMouseDown` and `onMouseUp` events. Step 3: 🔁 Code ReviewWorking on it... 🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. |
The
onClick
event can be a bit confusing, since some events are triggered onmousedown
and some are triggered onmouseup
.This is an opportunity to improve the options, using two different triggers for those events, or a flag in the
onClick
options or something like that.I think this is something that belongs to v3.0, it depends on how breaking it is. If new events are the best way to achieve it, the
onClick
can't exist anymore, since there's a conflict.Version 3.0 is ignoring more deprecated values, the
onClick
there will be changed anyway, it depends if this can be supported in 2.x as well.Checklist
engine/src/Options/Classes/Interactivity/Events/Events.ts
✅ Commitb73f4c9
engine/src/Core/Utils/EventListeners.ts
✅ Commit81fefd0
interactions/external/bubble/src/Bubbler.ts
✅ Commit5c56c9e
engine/src/Options/Classes/Interactivity/Events/DivEvent.ts
✅ Commite270ba3
The text was updated successfully, but these errors were encountered: