mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +08:00
Make the invoker responsible for positioning the composer cursor
This commit is contained in:
parent
7232c51290
commit
25ca1135b2
|
@ -43,11 +43,7 @@ export default class ComposerBody extends Component {
|
||||||
this.ready(true);
|
this.ready(true);
|
||||||
m.redraw();
|
m.redraw();
|
||||||
|
|
||||||
var $input = this.$().find(':input:enabled:visible:first');
|
this.$(':input:enabled:visible:first').focus();
|
||||||
if ($input.length) {
|
|
||||||
$input.focus();
|
|
||||||
$input[0].selectionStart = $input[0].selectionEnd = $input.val().length;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preventExit() {
|
preventExit() {
|
||||||
|
|
|
@ -133,7 +133,7 @@ class Composer extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render(anchorToBottom) {
|
render(anchorToBottom) {
|
||||||
if (this.position() === this.oldPosition) { return; }
|
if (this.position() === this.oldPosition) { this.component.focus(); return; }
|
||||||
|
|
||||||
var $composer = this.$().stop(true);
|
var $composer = this.$().stop(true);
|
||||||
var oldHeight = $composer.is(':visible') ? $composer.outerHeight() : 0;
|
var oldHeight = $composer.is(':visible') ? $composer.outerHeight() : 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user