FEATURE: focus on composer TEXTAREA when iPad has a physical keyboard
This disables a bunch of hacks that bypassed "focus" on iOS (cause focus events that involve a virtual keyboard on iOS cause browser havoc unless a physical keyboard is attached) Also will focus on title on new topic
This commit is contained in:
parent
6bc8382555
commit
cdf34657f6
|
@ -30,7 +30,8 @@ import {
|
|||
validateUploadedFiles,
|
||||
authorizesOneOrMoreImageExtensions,
|
||||
formatUsername,
|
||||
clipboardData
|
||||
clipboardData,
|
||||
safariHacksDisabled
|
||||
} from "discourse/lib/utilities";
|
||||
import {
|
||||
cacheShortUploadUrl,
|
||||
|
@ -201,7 +202,10 @@ export default Ember.Component.extend({
|
|||
}
|
||||
|
||||
// Focus on the body unless we have a title
|
||||
if (!this.get("composer.canEditTitle") && !this.capabilities.isIOS) {
|
||||
if (
|
||||
!this.get("composer.canEditTitle") &&
|
||||
(!this.capabilities.isIOS || safariHacksDisabled())
|
||||
) {
|
||||
this.$(".d-editor-input").putCursorAtEnd();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ import { findRawTemplate } from "discourse/lib/raw-templates";
|
|||
import { siteDir } from "discourse/lib/text-direction";
|
||||
import {
|
||||
determinePostReplaceSelection,
|
||||
clipboardData
|
||||
clipboardData,
|
||||
safariHacksDisabled
|
||||
} from "discourse/lib/utilities";
|
||||
import toMarkdown from "discourse/lib/to-markdown";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
|
@ -524,7 +525,7 @@ export default Ember.Component.extend({
|
|||
const $textarea = this.$("textarea.d-editor-input");
|
||||
const textarea = $textarea[0];
|
||||
const oldScrollPos = $textarea.scrollTop();
|
||||
if (!this.capabilities.isIOS) {
|
||||
if (!this.capabilities.isIOS || safariHacksDisabled()) {
|
||||
$textarea.focus();
|
||||
}
|
||||
textarea.selectionStart = from;
|
||||
|
|
|
@ -12,7 +12,8 @@ import { getOwner } from "discourse-common/lib/get-owner";
|
|||
import {
|
||||
escapeExpression,
|
||||
uploadIcon,
|
||||
authorizesOneOrMoreExtensions
|
||||
authorizesOneOrMoreExtensions,
|
||||
safariHacksDisabled
|
||||
} from "discourse/lib/utilities";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
import { shortDate } from "discourse/lib/formatter";
|
||||
|
@ -137,7 +138,7 @@ export default Ember.Controller.extend({
|
|||
"model.composeState"
|
||||
)
|
||||
focusTarget(replyingToTopic, creatingPM, usernames, composeState) {
|
||||
if (this.capabilities.isIOS) {
|
||||
if (this.capabilities.isIOS && !safariHacksDisabled()) {
|
||||
return "none";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue