[BUG]: destroy() method didn't fully remove events
See original GitHub issueversion: latest: v-0.16.3.
important: update from v-0.15.9 to v-0.16.3 while keep everything same, the error will show in console:
Uncaught TypeError: Cannot read property 'frameElement' of null
at r.getFrameOffset (grapes.min.js?a826:formatted:28973)
at r.getElementPos (grapes.min.js?a826:formatted:28985)
at r.getElementPos (grapes.min.js?a826:formatted:13792)
at r.updateLocalPos (grapes.min.js?a826:formatted:13444)
at r.onFrameUpdated (grapes.min.js?a826:formatted:13396)
at I (grapes.min.js?a826:formatted:554)
at eval (grapes.min.js?a826:formatted:566)
at eval (grapes.min.js?a826:formatted:129)
....
This error show there is a errro in function getFrameOffset
, near position: e.ownerDocument.defaultView.frameElement
:
...
clearOff: function() {
this.frmOff = null,
this.cvsOff = null
},
getFrameOffset: function(e) {
if (!this.frmOff || e) {
>>> var t = e ? e.ownerDocument.defaultView.frameElement : this.frame.el;
this.frmOff = this.offset(t)
}
return this.frmOff
},
getCanvasOffset: function() {
return this.cvsOff || (this.cvsOff = this.offset(this.el)),
this.cvsOff
}
...
Refer to This Code Line
Checking the error stack will track to This Code Line
Expected: no error reported. Impact: I do not get specific negitive impact, only show the error. Reproduce: I integrate with Vue usage + webpack, hard to really reproduce, to debug this probaly check:
- simply add check chain to avoid
TypeError
:
before: var t = e ? e.ownerDocument.defaultView.frameElement : this.frame.el;
after: var t= (e && e.ownerDocument && e.ownerDocument.defaultView && e.ownerDocument.defaultView.frameElement) || this.frame.el;
- if this
frameElement
is required, in what condition it will missing, and then cause error.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Tooltips are not removed from DOM after destroy event
it is a bug in older version of Bootstrap, So to fix it in older version you can remove the $tip element by...
Read more >Scripting API: Object.Destroy - Unity - Manual
Removes a GameObject, component or asset. The object obj is destroyed immediately after the current Update loop, or t seconds from now if...
Read more >Possible bug in ColVis button — DataTables forums
destroy() will remove any event handlers it has bound but if you created others they won't be removed. It supposed to leave the...
Read more >Excel VBA Events - An Easy (and Complete) Guide
Excel VBA Events allow you to run a macro when a specific event occurs. An event could be an action such as opening...
Read more >GraphicsLayer | ArcGIS Maps SDK for JavaScript 4.25
Returns an event handler with a remove() method that should be called to stop listening for the event(s). Property, Type, Description. remove, Function,...
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 Free
Top 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
Thank you @artf ! 🙏
I agree that this needs to be reopened and fixed within the destroy function itself.