Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ada5323

Browse files
committed
lib: ensure isPlotDiv accepts plain objects
1 parent de69b3d commit ada5323

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ lib.getPlotDiv = function(el) {
379379

380380
lib.isPlotDiv = function(el) {
381381
var el3 = d3.select(el);
382-
return el3.size() && el3.classed('js-plotly-plot');
382+
return el3.node() instanceof HTMLElement &&
383+
el3.size() &&
384+
el3.classed('js-plotly-plot');
383385
};
384386

385387
lib.removeElement = function(el) {

0 commit comments

Comments
 (0)