attempt to fix focus crash issue
This commit is contained in:
parent
62ef9d7bb0
commit
a03961f379
|
@ -256,31 +256,39 @@
|
||||||
this.store.setForCurrentTimeline({ ignoreBlurEvents: true })
|
this.store.setForCurrentTimeline({ ignoreBlurEvents: true })
|
||||||
},
|
},
|
||||||
saveFocus(e) {
|
saveFocus(e) {
|
||||||
let instanceName = this.store.get('currentInstance')
|
try {
|
||||||
let timelineName = this.get('timeline')
|
let instanceName = this.store.get('currentInstance')
|
||||||
let lastFocusedElementSelector
|
let timelineName = this.get('timeline')
|
||||||
let activeElement = e.target
|
let lastFocusedElementSelector
|
||||||
if (activeElement) {
|
let activeElement = e.target
|
||||||
let focusKey = activeElement.getAttribute('focus-key')
|
if (activeElement) {
|
||||||
if (focusKey) {
|
let focusKey = activeElement.getAttribute('focus-key')
|
||||||
lastFocusedElementSelector = `[focus-key=${JSON.stringify(focusKey)}]`
|
if (focusKey) {
|
||||||
|
lastFocusedElementSelector = `[focus-key=${JSON.stringify(focusKey)}]`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
console.log('saving focus to ', lastFocusedElementSelector)
|
||||||
|
this.store.setForTimeline(instanceName, timelineName, {
|
||||||
|
lastFocusedElementSelector
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.error('unable to save focus', err)
|
||||||
}
|
}
|
||||||
console.log('saving focus to ', lastFocusedElementSelector)
|
|
||||||
this.store.setForTimeline(instanceName, timelineName, {
|
|
||||||
lastFocusedElementSelector
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
clearFocus() {
|
clearFocus() {
|
||||||
if (this.store.get('ignoreBlurEvents')) {
|
try {
|
||||||
return
|
if (this.store.get('ignoreBlurEvents')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('clearing focus')
|
||||||
|
let instanceName = this.store.get('currentInstance')
|
||||||
|
let timelineName = this.get('timeline')
|
||||||
|
this.store.setForTimeline(instanceName, timelineName, {
|
||||||
|
lastFocusedElementSelector: null
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.error('unable to clear focus', err)
|
||||||
}
|
}
|
||||||
console.log('clearing focus')
|
|
||||||
let instanceName = this.store.get('currentInstance')
|
|
||||||
let timelineName = this.get('timeline')
|
|
||||||
this.store.setForTimeline(instanceName, timelineName, {
|
|
||||||
lastFocusedElementSelector: null
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue