File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
ft-playlist-add-video-prompt Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ export default defineComponent({
44
44
doSearchPlaylistsWithMatchingVideos : false ,
45
45
updateQueryDebounce : function ( ) { } ,
46
46
lastShownAt : Date . now ( ) ,
47
- lastActiveElement : null ,
48
47
sortBy : SORT_BY_VALUES . LatestUpdatedFirst ,
49
48
}
50
49
} ,
@@ -205,15 +204,13 @@ export default defineComponent({
205
204
} ,
206
205
} ,
207
206
mounted : function ( ) {
208
- this . lastActiveElement = document . activeElement
209
207
this . updateQueryDebounce = debounce ( this . updateQuery , 500 )
210
208
document . addEventListener ( 'keydown' , this . keyboardShortcutHandler )
211
209
// User might want to search first if they have many playlists
212
210
nextTick ( ( ) => this . $refs . searchBar . focus ( ) )
213
211
} ,
214
212
beforeDestroy ( ) {
215
213
document . removeEventListener ( 'keydown' , this . keyboardShortcutHandler )
216
- nextTick ( ( ) => this . lastActiveElement ?. focus ( ) )
217
214
} ,
218
215
methods : {
219
216
hide : function ( ) {
Original file line number Diff line number Diff line change 1
- import { defineComponent } from 'vue'
1
+ import { defineComponent , nextTick } from 'vue'
2
2
import { mapActions } from 'vuex'
3
3
import FtCard from '../../components/ft-card/ft-card.vue'
4
4
import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
@@ -54,10 +54,6 @@ export default defineComponent({
54
54
return sanitizeForHtmlId ( this . label )
55
55
}
56
56
} ,
57
- beforeDestroy : function ( ) {
58
- document . removeEventListener ( 'keydown' , this . closeEventFunction , true )
59
- this . lastActiveElement ?. focus ( )
60
- } ,
61
57
mounted : function ( ) {
62
58
this . lastActiveElement = document . activeElement
63
59
this . $nextTick ( ( ) => {
@@ -71,6 +67,10 @@ export default defineComponent({
71
67
this . focusItem ( 0 )
72
68
} )
73
69
} ,
70
+ beforeDestroy : function ( ) {
71
+ document . removeEventListener ( 'keydown' , this . closeEventFunction , true )
72
+ nextTick ( ( ) => this . lastActiveElement ?. focus ( ) )
73
+ } ,
74
74
methods : {
75
75
click : function ( value ) {
76
76
this . $emit ( 'click' , value )
You can’t perform that action at this time.
0 commit comments