Make the invoker responsible for positioning the composer cursor

This commit is contained in:
Toby Zerner 2015-05-23 08:34:54 +09:30
parent 7232c51290
commit 25ca1135b2
2 changed files with 2 additions and 6 deletions

View File

@ -43,11 +43,7 @@ export default class ComposerBody extends Component {
this.ready(true);
m.redraw();
var $input = this.$().find(':input:enabled:visible:first');
if ($input.length) {
$input.focus();
$input[0].selectionStart = $input[0].selectionEnd = $input.val().length;
}
this.$(':input:enabled:visible:first').focus();
}
preventExit() {

View File

@ -133,7 +133,7 @@ class Composer extends Component {
}
render(anchorToBottom) {
if (this.position() === this.oldPosition) { return; }
if (this.position() === this.oldPosition) { this.component.focus(); return; }
var $composer = this.$().stop(true);
var oldHeight = $composer.is(':visible') ? $composer.outerHeight() : 0;