Skip to content

Commit fdb0da4

Browse files
committed
Added comments about why we need to catch blur events
1 parent d4e02d7 commit fdb0da4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pages/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class Index extends React.Component {
7474

7575
componentDidMount() {
7676
document.onblur = () => {
77+
// Needed when the user clicks outside the document,
78+
// e.g. the browser address bar
7779
this.setFocus(null);
7880
}
7981
}
@@ -400,6 +402,8 @@ class Index extends React.Component {
400402
}
401403

402404
handleTextEditorBlur = () => {
405+
// Needed when the user clicks outside of a pane,
406+
// e.g. the app bar or the background
403407
this.setFocusIfFocusIs('TextEditor', null);
404408
}
405409

0 commit comments

Comments
 (0)