fix: image and paste insert (#490)
* fix: pasting and images only insert at beginning * fix: add image click not showing gallery * chore: increase code coverage
This commit is contained in:
@@ -87,6 +87,7 @@ export const hooks = {
|
||||
updateReactState({ settings, ...args });
|
||||
|
||||
close();
|
||||
args.setSelection(null);
|
||||
},
|
||||
onClose: ({ clearSelection, close }) => () => {
|
||||
clearSelection();
|
||||
@@ -130,7 +131,7 @@ export const ImageUploadModal = ({
|
||||
<ImageSettingsModal
|
||||
{...{
|
||||
isOpen,
|
||||
close: module.hooks.onClose({ editorRef, clearSelection, close }),
|
||||
close: module.hooks.onClose({ clearSelection, close }),
|
||||
selection,
|
||||
images,
|
||||
saveToEditor: module.hooks.createSaveCallback({
|
||||
@@ -141,6 +142,7 @@ export const ImageUploadModal = ({
|
||||
selection,
|
||||
setSelection,
|
||||
lmsEndpointUrl,
|
||||
clearSelection,
|
||||
}),
|
||||
returnToSelection: clearSelection,
|
||||
}}
|
||||
|
||||
@@ -128,6 +128,7 @@ describe('ImageUploadModal', () => {
|
||||
expect(updateImageDimensionsSpy.mock.results[0].value.foundMatch).toBe(false);
|
||||
expect(images.current).toEqual([mockImage, newImage]);
|
||||
expect(close).toBeCalled();
|
||||
expect(setSelection).toBeCalledWith(null);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user