0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-25 09:43:03 +00:00

fix ref issues and remove unneeded value

This commit is contained in:
Charlie Humphreys
2023-06-30 00:37:20 -05:00
parent 47c84d9f01
commit b7be2d6463
2 changed files with 23 additions and 8 deletions

View File

@@ -60,12 +60,11 @@ const CodeEditor = createClass({
getInitialState : function() {
return {
docs : {},
widgetUtils : {},
widgets : [],
focusedWidget : null,
hints : [],
hintsField : undefined,
docs : {},
widgetUtils : {},
widgets : [],
hints : [],
hintsField : undefined,
};
},

View File

@@ -87,8 +87,18 @@ const Hints = createClass({
let className = 'CodeMirror-hint';
if(activeHint === i) {
className += ' CodeMirror-hint-active';
return <li key={i}
className={className}
onMouseDown={(e)=>field.hintSelected(h, e)}
ref={this.activeHintRef}>
{h.hint}
</li>;
}
return <li key={i} className={className} onMouseDown={(e)=>field.hintSelected(h, e)}>{h.hint}</li>;
return <li key={i}
className={className}
onMouseDown={(e)=>field.hintSelected(h, e)}>
{h.hint}
</li>;
});
let style = {
@@ -103,7 +113,13 @@ const Hints = createClass({
};
}
return <React.Fragment>
<ul role={'listbox'} id={'hints'} aria-expanded={true} className={'CodeMirror-hints default'} style={style} onKeyDown={this.keyDown}>
<ul role={'listbox'}
id={'hints'}
aria-expanded={true}
className={'CodeMirror-hints default'}
style={style}
onKeyDown={this.keyDown}
ref={this.hintsRef}>
{hintElements}
</ul>
</React.Fragment>;