Change the onClick event to handle both mouseUp and mouseDown

Author: matteobruniCreated May 15, 2023Updated Feb 24, 2025
Labelsenhancementhelp wantedgood first issueup-for-grabspluginfeature_requestpinnedHacktoberfest

The onClick event can be a bit confusing, since some events are triggered on mousedown and some are triggered on mouseup.

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 ✅ Commit b73f4c9
  • engine/src/Core/Utils/EventListeners.ts ✅ Commit 81fefd0
  • interactions/external/bubble/src/Bubbler.ts ✅ Commit 5c56c9e
  • engine/src/Options/Classes/Interactivity/Events/DivEvent.ts ✅ Commit e270ba3
  • engine/src/Options/Interfaces/Interactivity/Events/IEvents.ts
  • engine/src/Options/Interfaces/Interactivity/Events/IClickEvent.ts
  • engine/src/Options/Classes/Interactivity/Events/ClickEvent.ts
  • markdown/Options/Interactivity/Events.md