mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 20:21:25 +08:00
FIX: After uploading an image the selection was not in the correct spot
This commit is contained in:
@ -596,3 +596,18 @@ componentTest('emoji', {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
testCase("replace-text event", function(assert, textarea) {
|
||||
|
||||
this.set('value', "red green blue");
|
||||
|
||||
andThen(() => {
|
||||
this.container.lookup('app-events:main').trigger('composer:replace-text', 'green', 'yellow');
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), 'red yellow blue');
|
||||
assert.equal(textarea.selectionStart, 10);
|
||||
assert.equal(textarea.selectionEnd, 10);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user