-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adds pointer capture and disabling support to eventcatcher widget #9609
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
base: master
Are you sure you want to change the base?
Adds pointer capture and disabling support to eventcatcher widget #9609
Conversation
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Confirmed: saqimtiaz has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
| Branch | Size |
|---|---|
| Base (master) | 2448.0 KB |
| PR | 2453.6 KB |
Diff: ⬆️ Increase: +5.6 KB
✅ Change Note Status
All change notes are properly formatted and validated!
📝 $:/changenotes/5.4.0/#9609
Type: enhancement | Category: widget
Release: 5.4.0
adds support for pointer capture and enabling/disabling the widget
🔗 #9609
👥 Contributors: saqimtiaz
📖 Change Note Guidelines
Change notes help track and communicate changes effectively. See the full documentation for details.
|
@Jermolene seeing as how this is a complete rewrite, should we take this opportunity to switch to using JavaScript classes?
|
This PR introduces three major enhancements to the EventCatcher widget:
Optional Pointer Capture Support
Adds native pointer capture handling to improve pointer event reliability and tracking outside the widget DOM nodes boundaries. When enabled, pointer events such as
pointermove,pointerup, andpointercancelare correctly captured and routed to the widget, even if the pointer moves off-screen or outside the element.The pointer capture logic supports two modes of event listener attachment for better performance and control.
Widget Enable/Disable Control
Adds a new attribute to enable or disable the EventCatcher widget at runtime. This allows users to temporarily deactivate event handling without removing the widget or disrupting the DOM structure, enhancing flexibility for dynamic UIs.
Access to a JSON blob containing event properties via the variable
eventJSON. The event.detail related variables have been deprecated as they were always brittle and the seem needs can now be met viaeventJSON.User-Facing Attributes
enabledyesno, all event listeners are removed.pointerCapturenoyes,no,dynamic).Detailed Behavior of
pointerCaptureWhen
pointerCaptureisdynamicpointerdown,pointerupandpointercancelevent listeners at the appropriate time even if they are not specified in the widget attributes.pointerdownevent listener is attached when the widget is initialized and when apointerdownoccurs, pointer capture is set withsetPointerCapture.pointeruppointercancelpointermove(only if the user has specified it in the widget attributes)pointeruporpointercancel), these active listeners are removed, and pointer capture is released.When
dynamicPointerListenersisyespointerdownhas been specified, it initiates pointer capture.pointeruporpointercancelhave been specified, they release pointer capture.To Do: