소스 검색

Make it run on the editing part of the API only. And use mapDomToView() to avoid failing on elements which weren't converted so far (which means they will never be, and should not be here). This makes all image tests pass.

Piotrek Koszuliński 6 년 전
부모
커밋
bbf141b9d8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/ckeditor5-image/src/imageupload/imageuploadediting.js

+ 2 - 2
packages/ckeditor5-image/src/imageupload/imageuploadediting.js

@@ -196,14 +196,14 @@ export default class ImageUploadEditing extends Plugin {
 				// Force re–paint in Safari. Without it, the image will display with a wrong size.
 				// https://github.com/ckeditor/ckeditor5/issues/1975
 				if ( env.isSafari ) {
-					editor.ui.once( 'update', () => {
+					editor.editing.view.once( 'render', () => {
 						// Early returns just to be safe. There might be some code ran
 						// in between the outer scope and this callback.
 						if ( !viewImg.parent ) {
 							return;
 						}
 
-						const domFigure = editor.editing.view.domConverter.viewToDom( viewImg.parent );
+						const domFigure = editor.editing.view.domConverter.mapDomToView( viewImg.parent );
 
 						if ( !domFigure ) {
 							return;