We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25d055e commit 60e841eCopy full SHA for 60e841e
browser/main/Detail/MarkdownNoteDetail.js
@@ -85,11 +85,15 @@ class MarkdownNoteDetail extends React.Component {
85
// Focus content if using blur or double click
86
// --> Moved here from componentDidMount so a re-render during search won't set focus to the editor
87
const {switchPreview} = nextProps.config.editor
88
- this.setState({
89
- switchPreview
90
- })
91
- if (switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK') {
92
- this.focus()
+
+ if (this.state.switchPreview !== switchPreview) {
+ this.setState({
+ switchPreview
+ })
93
+ if (switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK') {
94
+ console.log('setting focus', switchPreview)
95
+ this.focus()
96
+ }
97
}
98
99
0 commit comments