Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit e7bcd22

Browse files
committed
Koenig - Fixed backspace not removing card after inserting Unsplash image
refs TryGhost/Ghost#9724 - focus was not being returned to the editor after the Unsplash modal was closed so although the image card looked selected the editor was not responding to any key commands
1 parent 482188b commit e7bcd22

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/koenig-editor/addon/components/koenig-card-image.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ export default Component.extend({
182182

183183
selectFromImageSelector({src, caption, alt}) {
184184
let {payload, saveCard} = this;
185-
let imageSelector, searchTerm;
185+
let searchTerm;
186186

187-
setProperties(payload, {src, caption, alt, imageSelector, searchTerm});
187+
setProperties(payload, {src, caption, alt, searchTerm});
188+
189+
this.send('closeImageSelector');
188190

189191
saveCard(payload, false);
190192
},
@@ -195,6 +197,10 @@ export default Component.extend({
195197
}
196198

197199
set(this.payload, 'imageSelector', undefined);
200+
201+
// ensure focus is returned to the editor so that the card which
202+
// appears selected behaves as if it's selected
203+
this.editor.focus();
198204
}
199205
},
200206

0 commit comments

Comments
 (0)