Skip to content
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

fix(pubsub): externalize PubSub event to SlickEventData to stop bubbling #1444

Merged
merged 2 commits into from Mar 27, 2024

Conversation

ghiscoding
Copy link
Owner

  • add a way to externalize the Custom Event used internally by the PubSub Service so that the user could call preventDefault() on the SlickEventData as well, for example the CompositeEditor demo has the event onBeforeEditCell and if the user calls the preventDefault even on the SlickEventData (e.g. with Aurelia or Angular), then the SlickGrid .notify should receive a returnValue of false because when the PubSub calls the dispatchEvent with an event that was prevented, then the returnValue will be false, see MDN for reference: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent#return_value
  • this fixes an issue that I've opened on Aurelia project via this issue comment and Aurelia-Slickgrid PR that was a temp fix, the PR here will fix it in a proper and correct way to handle the event

- add a way to externalize the Custom Event used internally by the PubSub Service so that the user could call `preventDefault()` on the SlickEventData as well, for example the CompositeEditor demo has the event `onBeforeEditCell` and if the user calls the `preventDefault` even on the SlickEventData (e.g. with Aurelia or Angular), then the SlickGrid `.notify` should receive a `returnValue` of `false` because when the PubSub calls the `dispatchEvent` with an event that was prevented, then the `returnValue` will be `false`, see MDN for reference: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent#return_value
Copy link

stackblitz bot commented Mar 27, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.8%. Comparing base (a2cfbc6) to head (4e0e64f).

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1444     +/-   ##
========================================
+ Coverage    99.8%   99.8%   +0.1%     
========================================
  Files         199     199             
  Lines       21617   21621      +4     
  Branches     7235    6967    -268     
========================================
+ Hits        21553   21557      +4     
- Misses         58      64      +6     
+ Partials        6       0      -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghiscoding ghiscoding merged commit 973d0ab into master Mar 27, 2024
6 checks passed
@ghiscoding ghiscoding deleted the bugfix/externalize-pubsub-event branch March 27, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant