1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix input position when going fullscreen or resizing splitEditor

This commit is contained in:
Baptiste Augrain
2018-09-17 21:39:57 +02:00
parent 03b8dbbc44
commit 5ef84e4bfc
2 changed files with 108 additions and 4 deletions

View File

@@ -292,6 +292,10 @@ export default class CodeEditor extends React.Component {
this.editor.on('cursorActivity', this.editorActivityHandler)
this.editor.on('changes', this.editorActivityHandler)
}
this.setState({
clientWidth: this.refs.root.clientWidth
})
}
expandSnippet (line, cursor, cm, snippets) {
@@ -441,6 +445,14 @@ export default class CodeEditor extends React.Component {
this.editor.setOption('extraKeys', this.defaultKeyMap)
}
if (this.state.clientWidth !== this.refs.root.clientWidth) {
this.setState({
clientWidth: this.refs.root.clientWidth
})
needRefresh = true
}
if (needRefresh) {
this.editor.refresh()
}