attempt to fix focus crash issue

This commit is contained in:
Nolan Lawson 2018-03-22 19:56:08 -07:00
parent 62ef9d7bb0
commit a03961f379

View file

@ -256,6 +256,7 @@
this.store.setForCurrentTimeline({ ignoreBlurEvents: true }) this.store.setForCurrentTimeline({ ignoreBlurEvents: true })
}, },
saveFocus(e) { saveFocus(e) {
try {
let instanceName = this.store.get('currentInstance') let instanceName = this.store.get('currentInstance')
let timelineName = this.get('timeline') let timelineName = this.get('timeline')
let lastFocusedElementSelector let lastFocusedElementSelector
@ -270,8 +271,12 @@
this.store.setForTimeline(instanceName, timelineName, { this.store.setForTimeline(instanceName, timelineName, {
lastFocusedElementSelector lastFocusedElementSelector
}) })
} catch (err) {
console.error('unable to save focus', err)
}
}, },
clearFocus() { clearFocus() {
try {
if (this.store.get('ignoreBlurEvents')) { if (this.store.get('ignoreBlurEvents')) {
return return
} }
@ -281,6 +286,9 @@
this.store.setForTimeline(instanceName, timelineName, { this.store.setForTimeline(instanceName, timelineName, {
lastFocusedElementSelector: null lastFocusedElementSelector: null
}) })
} catch (err) {
console.error('unable to clear focus', err)
}
} }
} }
} }