BUG - dispatchEvent should be cancelable
See original GitHub issueI’m submitting a bug report
Current behavior:
All SlickGrid called through EventDispatch should be cancelable, and this requirement is necessary for some of the subscribed event. The event that I currently have problem with is onBeforeEditCell
and as answered by the author of SlickGrid in this SO, the way to cancel an edit is to return false
which doesn’t do anything when currently used with EventDispatch
Expected/desired behavior:
-
What is the expected behavior? EventDispatch should be cancelable
-
What is the motivation / use case for changing the behavior? Have the same behavior as regular SlickGrid subscribed event.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
dispatchEvent(name:canBubble:cancellable:extraInfo ...
A flag indicating whether the event is cancelable. extraInfo. Extra properties that need to be exposed in the event object. completion.
Read more >EventTarget.dispatchEvent() - Web APIs | MDN
false if event is cancelable, and at least one of the event handlers which received event called Event.preventDefault() . Otherwise true .
Read more >javascript - dispatchEvent Causes error failed to execute ...
failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. I have tried everything, and found out that this will...
Read more >730108 - In theory, dispatchEvent(new Event('submit')) should ...
The form submission algorithm spec [1] describes only a cancelable 'submit' event so Chromium implementation might have simply overlooked the ...
Read more >Programmatic submit does not work in React 17 #878 - GitHub
Bug What is the current behavior? Submission using form.dispatchEvent(new Event('submit', { cancelable: true })) does not work after ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I actually found the problem with Angular, I forgot to return the
dispatchEvent
which is needed to return falseThat could help lol
I will push a commit to address this over the weekend, I will also do them as
cancelable
on all thedispatchEvent
, not just the ones with prefix.Oh that is interesting, thanks for that, I really didn’t think about changing the arguments as I always do copy & paste lol.
What I like about Aurelia is that they follow the standard and Angular…not so much… and even
e.preventDefault()
doesn’t prevent the editing. I wouldn’t be surprised that Angular doesn’t handledispatchEvent
event correctly, this might be because in Aurelia we usedelegate
instead oftrigger
I might have to stick with the SlickGrid way until I find the solution (if there is) in Angular
just too bad because I need to
unsubscribe
as well 😦