mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed hang in editor when back button is pressed whilst feature image caption is focused (#19367)
closes https://github.com/TryGhost/Product/issues/4228 - when leaving the editor via back button the feature image caption editor's blur handler was called by the React editor component after Ember had torn down the route resulting in an attempt to use `post.set()` when `post` doesn't exist - the error also caused Lexical to re-render to try and recover which then triggered the blur handler again resulting in an infinite loop - adding a check to ensure `this.post` exists was enough to fix the problem
This commit is contained in:
parent
69a8f71bd1
commit
b74a611fbd
1 changed files with 1 additions and 1 deletions
|
@ -415,7 +415,7 @@ export default class LexicalEditorController extends Controller {
|
|||
|
||||
@action
|
||||
handleFeatureImageCaptionBlur() {
|
||||
if (this.post.isDraft) {
|
||||
if (this.post?.isDraft) {
|
||||
this.autosaveTask.perform();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue