0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-27 20:23:08 +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 f52d42bef5
commit 51760e02e7
2 changed files with 23 additions and 8 deletions

View File

@@ -63,7 +63,6 @@ const CodeEditor = createClass({
docs : {}, docs : {},
widgetUtils : {}, widgetUtils : {},
widgets : [], widgets : [],
focusedWidget : null,
hints : [], hints : [],
hintsField : undefined, hintsField : undefined,
}; };

View File

@@ -87,8 +87,18 @@ const Hints = createClass({
let className = 'CodeMirror-hint'; let className = 'CodeMirror-hint';
if(activeHint === i) { if(activeHint === i) {
className += ' CodeMirror-hint-active'; 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 = { let style = {
@@ -103,7 +113,13 @@ const Hints = createClass({
}; };
} }
return <React.Fragment> 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} {hintElements}
</ul> </ul>
</React.Fragment>; </React.Fragment>;