Refactor get initialHeightClassName()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2022-12-26 12:42:01 +03:00
1 parent 46732dec1f
commit 66a287437a
1 file changed
+3 -7
@@ -292,13 +292,9 @@ class NonInjectedMonacoEditor extends React.Component<MonacoEditorProps & Depend
validateLazy = debounce(this.validate, 250); validateLazy = debounce(this.validate, 250);
get initialHeightClassName() { get initialHeightClassName() {
if (!this.props.setInitialHeight) { return this.props.setInitialHeight ?
return; styles[this.props.getEditorHeightFromLinesNumber(this.model.getLineCount())] :
} null;
const lines = this.model.getLineCount();
return styles[this.props.getEditorHeightFromLinesNumber(lines)];
} }
render() { render() {