File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -83,18 +83,19 @@ export default class ResultView {
83
83
if ( ev . button === 1 ) {
84
84
// middle mouse button
85
85
this . model . remove ( )
86
- this . focusEditor ( )
86
+ this . focusPrevious ( )
87
87
} else if ( document . getSelection ( ) . toString ( ) . length === 0 ) {
88
- this . focusEditor ( )
88
+ this . focusPrevious ( )
89
89
}
90
90
} )
91
91
92
92
this . view . addEventListener ( 'mousedown' , ev => {
93
93
this . blurEditor ( )
94
+ this . previousFocus = document . activeElement
94
95
} )
95
96
96
97
this . view . addEventListener ( 'mouseleave' , ev => {
97
- this . focusEditor ( )
98
+ this . focusPrevious ( )
98
99
} )
99
100
100
101
if ( fade ) this . fadeIn ( )
@@ -113,10 +114,9 @@ export default class ResultView {
113
114
}
114
115
}
115
116
116
- focusEditor ( ) {
117
- const c = this . model . editor . component
118
- if ( c && c . didFocus ) {
119
- c . didFocus ( )
117
+ focusPrevious ( ) {
118
+ if ( this . previousFocus ) {
119
+ this . previousFocus . focus ( )
120
120
}
121
121
}
122
122
You can’t perform that action at this time.
0 commit comments