@@ -339,17 +339,21 @@ var MPLCanvasView = widgets.DOMWidgetView.extend({
339339 } ,
340340
341341 _init_canvas : function ( ) {
342+ var canvas_container = document . createElement ( 'div' ) ;
343+ canvas_container . classList = 'jupyter-widgets jupyter-matplotlib-canvas-container' ;
344+ this . figure . appendChild ( canvas_container ) ;
345+
342346 var canvas_div = this . canvas_div = document . createElement ( 'div' ) ;
343347 canvas_div . style . position = 'relative' ;
344348 canvas_div . style . clear = 'both' ;
345- canvas_div . classList = 'jupyter-widgets jupyter-matplotlib-canvas_div ' ;
349+ canvas_div . classList = 'jupyter-widgets jupyter-matplotlib-canvas-div ' ;
346350
347351 canvas_div . addEventListener ( 'keydown' , this . key_event ( 'key_press' ) ) ;
348352 canvas_div . addEventListener ( 'keyup' , this . key_event ( 'key_release' ) ) ;
349353
350354 // this is important to make the div 'focusable'
351355 canvas_div . setAttribute ( 'tabindex' , 0 ) ;
352- this . figure . appendChild ( canvas_div ) ;
356+ canvas_container . appendChild ( canvas_div ) ;
353357
354358 var canvas = this . canvas = document . createElement ( 'canvas' ) ;
355359 canvas . style . display = 'block' ;
@@ -520,12 +524,6 @@ var MPLCanvasView = widgets.DOMWidgetView.extend({
520524 step : event . step ,
521525 guiEvent : utils . get_simple_keys ( event ) } ) ;
522526 }
523-
524- /* This prevents the web browser from automatically changing to
525- * the text insertion cursor when the button is pressed. We want
526- * to control all of the cursor setting manually through the
527- * 'cursor' event from matplotlib */
528- event . preventDefault ( ) ;
529527 } ;
530528 } ,
531529
0 commit comments