mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Automatically focus on composer textarea on iOS. closes flarum/core#995
This commit is contained in:
parent
9059b7ad79
commit
ed0691a071
12
framework/core/js/forum/dist/app.js
vendored
12
framework/core/js/forum/dist/app.js
vendored
|
@ -20163,6 +20163,7 @@ System.register('flarum/components/Composer', ['flarum/Component', 'flarum/utils
|
||||||
if (this.isFullScreen()) {
|
if (this.isFullScreen()) {
|
||||||
this.$().css('top', $(window).scrollTop());
|
this.$().css('top', $(window).scrollTop());
|
||||||
this.showBackdrop();
|
this.showBackdrop();
|
||||||
|
this.component.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -26249,18 +26250,15 @@ System.register('flarum/components/ReplyPlaceholder', ['flarum/Component', 'flar
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerClick(e) {
|
|
||||||
$(this).trigger('click');
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
var reply = function reply() {
|
var reply = function reply() {
|
||||||
DiscussionControls.replyAction.call(_this2.props.discussion, true);
|
DiscussionControls.replyAction.call(_this2.props.discussion, true).then(function (newComponent) {
|
||||||
|
newComponent.focus();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return m(
|
return m(
|
||||||
'article',
|
'article',
|
||||||
{ className: 'Post ReplyPlaceholder', onclick: reply, onmousedown: triggerClick },
|
{ className: 'Post ReplyPlaceholder', onclick: reply },
|
||||||
m(
|
m(
|
||||||
'header',
|
'header',
|
||||||
{ className: 'Post-header' },
|
{ className: 'Post-header' },
|
||||||
|
|
|
@ -362,6 +362,7 @@ class Composer extends Component {
|
||||||
if (this.isFullScreen()) {
|
if (this.isFullScreen()) {
|
||||||
this.$().css('top', $(window).scrollTop());
|
this.$().css('top', $(window).scrollTop());
|
||||||
this.showBackdrop();
|
this.showBackdrop();
|
||||||
|
this.component.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,17 +31,14 @@ export default class ReplyPlaceholder extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerClick(e) {
|
|
||||||
$(this).trigger('click');
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
const reply = () => {
|
const reply = () => {
|
||||||
DiscussionControls.replyAction.call(this.props.discussion, true);
|
DiscussionControls.replyAction.call(this.props.discussion, true).then(function (newComponent) {
|
||||||
|
newComponent.focus();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className="Post ReplyPlaceholder" onclick={reply} onmousedown={triggerClick}>
|
<article className="Post ReplyPlaceholder" onclick={reply}>
|
||||||
<header className="Post-header">
|
<header className="Post-header">
|
||||||
{avatar(app.session.user, {className: 'PostUser-avatar'})}{' '}
|
{avatar(app.session.user, {className: 'PostUser-avatar'})}{' '}
|
||||||
{app.translator.trans('core.forum.post_stream.reply_placeholder')}
|
{app.translator.trans('core.forum.post_stream.reply_placeholder')}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user