@@ -383,6 +383,7 @@ class Index extends React.Component {
383
383
384
384
render ( ) {
385
385
const { classes } = this . props ;
386
+ const editorIsOpen = ! this . state . nodeFormatDrawerIsOpen && ! this . state . edgeFormatDrawerIsOpen ;
386
387
387
388
var columns ;
388
389
if ( this . state . insertPanelsAreOpen && this . state . graphInitialized ) {
@@ -472,22 +473,22 @@ class Index extends React.Component {
472
473
onColorChange = { this . handleEdgeColorChange }
473
474
onFillColorChange = { this . handleEdgeFillColorChange }
474
475
/>
475
- < div >
476
- { this . state . nodeFormatDrawerIsOpen || this . state . edgeFormatDrawerIsOpen || (
477
- < TextEditor
478
- // allocated viewport width - 2 * padding
479
- width = { `calc( ${ columns . textEditor * 100 / 12 } vw - 2 * 12px)` }
480
- dotSrc = { this . state . dotSrc }
481
- onTextChange = { this . handleTextChange }
482
- error = { this . state . error }
483
- selectedGraphComponents = { this . state . selectedGraphComponents }
484
- holdOff = { this . state . holdOff }
485
- fontSize = { this . state . fontSize }
486
- tabSize = { this . state . tabSize }
487
- registerUndo = { this . registerUndo }
488
- registerRedo = { this . registerRedo }
489
- />
490
- ) }
476
+ < div style = { { display : editorIsOpen ? 'block' : 'none' } } >
477
+ < TextEditor
478
+ // allocated viewport width - 2 * padding
479
+ width = { `calc( ${ columns . textEditor * 100 / 12 } vw - 2 * 12px)` }
480
+ dotSrc = { this . state . dotSrc }
481
+ onTextChange = { this . handleTextChange }
482
+ onFocus = { this . handleTextEditorFocus }
483
+ onBlur = { this . handleTextEditorBlur }
484
+ error = { this . state . error }
485
+ selectedGraphComponents = { this . state . selectedGraphComponents }
486
+ holdOff = { this . state . holdOff }
487
+ fontSize = { this . state . fontSize }
488
+ tabSize = { this . state . tabSize }
489
+ registerUndo = { this . registerUndo }
490
+ registerRedo = { this . registerRedo }
491
+ />
491
492
</ div >
492
493
</ Paper >
493
494
</ Grid >
0 commit comments