Skip to content

Commit 1cccba5

Browse files
committed
add a comment
1 parent 7325807 commit 1cccba5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inst/htmlwidgets/plotly.js

+6
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ HTMLWidgets.widget({
289289
);
290290
});
291291
graphDiv.on('plotly_selected', function(d) {
292+
// If 'plotly_selected' has already been fired, and you click
293+
// on the plot afterwards, this event fires `undefined`?!?
294+
// That might be considered a plotly.js bug, but it doesn't make
295+
// sense for this input change to occur if `d` is falsy because,
296+
// even in the empty selection case, `d` is truthy (an object),
297+
// and the 'plotly_deselect' event will reset this input
292298
if (d) {
293299
Shiny.onInputChange(
294300
".clientValue-plotly_selected-" + x.source,

0 commit comments

Comments
 (0)