1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 01:31:40 +02:00

Focus at the end of the textarea when showing composer

This commit is contained in:
Toby Zerner
2015-05-14 22:13:05 +09:30
parent 222b81e917
commit fb834675b9

View File

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