@@ -101,7 +101,6 @@ export default {
101
101
this . hideScroll ( )
102
102
} else {
103
103
this . removeOverlay ( )
104
- this . unbind ( )
105
104
}
106
105
} ,
107
106
fullscreen ( val ) {
@@ -130,10 +129,6 @@ export default {
130
129
}
131
130
} ,
132
131
133
- beforeDestroy ( ) {
134
- if ( typeof window !== 'undefined' ) this . unbind ( )
135
- } ,
136
-
137
132
methods : {
138
133
animateClick ( ) {
139
134
this . animate = false
@@ -176,13 +171,6 @@ export default {
176
171
show ( ) {
177
172
! this . fullscreen && ! this . hideOverlay && this . genOverlay ( )
178
173
this . $refs . content . focus ( )
179
- this . bind ( )
180
- } ,
181
- bind ( ) {
182
- window . addEventListener ( 'focusin' , this . onFocusin )
183
- } ,
184
- unbind ( ) {
185
- window . removeEventListener ( 'focusin' , this . onFocusin )
186
174
} ,
187
175
onKeydown ( e ) {
188
176
if ( e . keyCode === keyCodes . esc && ! this . getOpenDependents ( ) . length ) {
@@ -196,25 +184,6 @@ export default {
196
184
}
197
185
this . $emit ( 'keydown' , e )
198
186
} ,
199
- onFocusin ( e ) {
200
- const { target } = e
201
-
202
- if (
203
- // It isn't the document or the dialog body
204
- ! [ document , this . $refs . content ] . includes ( target ) &&
205
- // It isn't inside the dialog body
206
- ! this . $refs . content . contains ( target ) &&
207
- // We're the topmost dialog
208
- this . activeZIndex >= this . getMaxZIndex ( ) &&
209
- // It isn't inside a dependent element (like a menu)
210
- ! this . getOpenDependentElements ( ) . some ( el => el . contains ( target ) )
211
- // So we must have focused something outside the dialog and its children
212
- ) {
213
- // Find and focus the first available element inside the dialog
214
- const focusable = this . $refs . content . querySelectorAll ( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' )
215
- focusable . length && focusable [ 0 ] . focus ( )
216
- }
217
- } ,
218
187
getActivator ( e ) {
219
188
if ( this . $refs . activator ) {
220
189
return this . $refs . activator . children . length > 0
0 commit comments