mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 04:31:56 +08:00
FIX: Autocomplete wasn't properly updating d-editor
This commit is contained in:
parent
8349669f8e
commit
08e43588f6
|
@ -301,6 +301,9 @@ export default Ember.Component.extend({
|
|||
$editorInput.autocomplete({
|
||||
template: template,
|
||||
key: ":",
|
||||
afterComplete(text) {
|
||||
self.set('value', text);
|
||||
},
|
||||
|
||||
transformComplete(v) {
|
||||
if (v.code) {
|
||||
|
|
|
@ -146,6 +146,10 @@ export default function(options) {
|
|||
text = text.substring(0, completeStart) + (options.key || "") + term + ' ' + text.substring(completeEnd + 1, text.length);
|
||||
me.val(text);
|
||||
Discourse.Utilities.setCaretPosition(me[0], completeStart + 1 + term.length);
|
||||
|
||||
if (options && options.afterComplete) {
|
||||
options.afterComplete(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,3 +27,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{plugin-outlet "discovery-below"}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user