mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge pull request #2406 from daiyam/fix-input-position
fix input position when going fullscreen or resizing splitEditor
This commit is contained in:
@@ -292,6 +292,10 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.editor.on('cursorActivity', this.editorActivityHandler)
|
this.editor.on('cursorActivity', this.editorActivityHandler)
|
||||||
this.editor.on('changes', this.editorActivityHandler)
|
this.editor.on('changes', this.editorActivityHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
clientWidth: this.refs.root.clientWidth
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
expandSnippet (line, cursor, cm, snippets) {
|
expandSnippet (line, cursor, cm, snippets) {
|
||||||
@@ -441,6 +445,14 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.editor.setOption('extraKeys', this.defaultKeyMap)
|
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) {
|
if (needRefresh) {
|
||||||
this.editor.refresh()
|
this.editor.refresh()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user