Skip to content

Commit 9e3ac1b

Browse files
committed
updatemenus: fix smooth dropdown folding
1 parent f17773f commit 9e3ac1b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/updatemenus/draw.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,13 @@ function drawButtons(gd, gHeader, gButton, menuOpts) {
254254

255255
exit.transition()
256256
.attr('opacity', '0')
257-
.remove();
257+
.remove()
258+
.each('end', function() {
259+
// remove the scrollbox, if all the buttons have been removed
260+
if(gButton.selectAll('g.' + klass).size() === 0) {
261+
gButton.call(removeAllButtons);
262+
}
263+
});
258264
} else {
259265
exit.remove();
260266
}
@@ -316,8 +322,6 @@ function drawButtons(gd, gHeader, gButton, menuOpts) {
316322

317323
Plots.executeAPICommand(gd, buttonOpts.method, buttonOpts.args);
318324

319-
scrollBox.disable();
320-
321325
gd.emit('plotly_buttonclicked', {menu: menuOpts, button: buttonOpts, active: menuOpts.active});
322326
});
323327

0 commit comments

Comments
 (0)