From f4938f9d118d0a670e9ae6619f207787a97381bf Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 5 Sep 2019 15:17:33 +0200 Subject: [PATCH] dont format empty ranges --- src/components/views/rooms/BasicMessageComposer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 3d2b96f773..36e142c0ea 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -434,6 +434,9 @@ export default class BasicMessageEditor extends React.Component { this._editorRef, this.props.model, document.getSelection()); + if (range.length === 0) { + return; + } switch (action) { case "bold": formatInline(range, "**");