From b7be2d6463c5de45a1fa6552677db049526fb1a8 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Fri, 30 Jun 2023 00:37:20 -0500 Subject: [PATCH] fix ref issues and remove unneeded value --- shared/naturalcrit/codeEditor/codeEditor.jsx | 11 +++++----- .../helpers/widget-elements/hints/hints.jsx | 20 +++++++++++++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index 137c3ef4a..86cf36104 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -60,12 +60,11 @@ const CodeEditor = createClass({ getInitialState : function() { return { - docs : {}, - widgetUtils : {}, - widgets : [], - focusedWidget : null, - hints : [], - hintsField : undefined, + docs : {}, + widgetUtils : {}, + widgets : [], + hints : [], + hintsField : undefined, }; }, diff --git a/shared/naturalcrit/codeEditor/helpers/widget-elements/hints/hints.jsx b/shared/naturalcrit/codeEditor/helpers/widget-elements/hints/hints.jsx index 6227b02b1..a20ab6bf4 100644 --- a/shared/naturalcrit/codeEditor/helpers/widget-elements/hints/hints.jsx +++ b/shared/naturalcrit/codeEditor/helpers/widget-elements/hints/hints.jsx @@ -87,8 +87,18 @@ const Hints = createClass({ let className = 'CodeMirror-hint'; if(activeHint === i) { className += ' CodeMirror-hint-active'; + return
  • field.hintSelected(h, e)} + ref={this.activeHintRef}> + {h.hint} +
  • ; } - return
  • field.hintSelected(h, e)}>{h.hint}
  • ; + return
  • field.hintSelected(h, e)}> + {h.hint} +
  • ; }); let style = { @@ -103,7 +113,13 @@ const Hints = createClass({ }; } return -