= React.createRef();
constructor(props: IEquationViewInternal) {
super(props);
this._fieldKey = this.props.fieldKey;
this._textBoxDoc = this.props.tbox.props.Document;
}
componentWillUnmount() {
this._reactionDisposer?.();
}
componentDidMount() {
this.props.setEditor(this._ref.current ?? undefined);
}
render() {
return (
{
if (e.key === 'Enter') {
this.props.tbox.EditorView!.dispatch(this.props.tbox.EditorView!.state.tr.setSelection(new TextSelection(this.props.tbox.EditorView!.state.doc.resolve(this.props.getPos() + 1))));
this.props.tbox.EditorView!.focus();
e.preventDefault();
}
e.stopPropagation();
}}
onKeyPress={e => e.stopPropagation()}
style={{
position: 'relative',
display: 'inline-block',
width: this.props.width,
height: this.props.height,
background: 'white',
borderRadius: '10%',
bottom: 3,
}}>
(this._textBoxDoc[this._fieldKey] = str)}
autoCommands="pi theta sqrt sum prod alpha beta gamma rho"
autoOperatorNames="sin cos tan"
spaceBehavesLikeTab={true}
/>
);
}
}