diff --git a/app/assets/javascripts/discourse/components/composer-editor.js.es6 b/app/assets/javascripts/discourse/components/composer-editor.js.es6 index add52b7f094..50572c40e59 100644 --- a/app/assets/javascripts/discourse/components/composer-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/composer-editor.js.es6 @@ -388,6 +388,9 @@ export default Ember.Component.extend({ left = replyWidth - popupWidth - 40; } + const selected = toolbarEvent.selected; + toolbarEvent.selectText(selected.start, selected.end - selected.start); + this.sendAction('showOptions', toolbarEvent, { position: "absolute", left, top }); }, diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 9a4382a86bd..8f8d5397e05 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -507,6 +507,7 @@ export default Ember.Component.extend({ const selected = this._getSelected(button.trimLeading); const toolbarEvent = { selected, + selectText: (from, length) => this._selectText(from, length), applySurround: (head, tail, exampleKey) => this._applySurround(selected, head, tail, exampleKey), applyList: (head, exampleKey) => this._applyList(selected, head, exampleKey), addText: text => this._addText(selected, text),