Skip to content

Commit

Permalink
fix: set image attributes during resize
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Jan 14, 2022
1 parent 6888b03 commit c4f9426
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion projects/demo/src/app/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default {
attrs: {
src: 'https://gameranx.com/wp-content/uploads/2016/03/Rise-of-the-Tomb-Raider-4K-Wallpaper-3.jpg',
alt: null,
title: null,
title: 'Lara Croft - Tomb Raider',
width: '578px'
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-editor/src/lib/plugins/image-resize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class ImageRezieView implements NodeView {
const { tr } = state;

const transaction = tr.setNodeMarkup(this.getPos(), undefined, {
src: this.imageComponentRef.instance.src,
width: this.imageComponentRef.instance.outerWidth
...this.node.attrs,
width: this.imageComponentRef.instance.outerWidth,
});

const resolvedPos = transaction.doc.resolve(this.getPos());
Expand Down

0 comments on commit c4f9426

Please sign in to comment.