From fc21d178bd636229ba8338c3f3f9c12cc267a8d3 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 9 May 2019 00:01:47 -0400
Subject: keep image selected on pointer up.

---
 src/client/util/RichTextSchema.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/client/util/RichTextSchema.tsx')

diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index c036bfe97..c0e6f7899 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -368,6 +368,7 @@ export class ImageResizeView {
         let self = this;
         this._handle.onpointerdown = function (e: any) {
             e.preventDefault();
+            e.stopPropagation();
             const startX = e.pageX;
             const startWidth = parseFloat(node.attrs.width);
             const onpointermove = (e: any) => {
@@ -381,7 +382,8 @@ export class ImageResizeView {
                 document.removeEventListener("pointerup", onpointerup);
                 view.dispatch(
                     view.state.tr.setNodeMarkup(getPos(), null,
-                        { src: node.attrs.src, width: self._outer.style.width }));
+                        { src: node.attrs.src, width: self._outer.style.width })
+                        .setSelection(view.state.selection));
             }
 
             document.addEventListener("pointermove", onpointermove)
-- 
cgit v1.2.3-70-g09d2

