mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
fix focus loss by checking switchPrieview prop change
This commit is contained in:
@@ -85,11 +85,15 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
// Focus content if using blur or double click
|
// Focus content if using blur or double click
|
||||||
// --> Moved here from componentDidMount so a re-render during search won't set focus to the editor
|
// --> Moved here from componentDidMount so a re-render during search won't set focus to the editor
|
||||||
const {switchPreview} = nextProps.config.editor
|
const {switchPreview} = nextProps.config.editor
|
||||||
this.setState({
|
|
||||||
switchPreview
|
if (this.state.switchPreview !== switchPreview) {
|
||||||
})
|
this.setState({
|
||||||
if (switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK') {
|
switchPreview
|
||||||
this.focus()
|
})
|
||||||
|
if (switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK') {
|
||||||
|
console.log('setting focus', switchPreview)
|
||||||
|
this.focus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user