skip put-cursor-to-end for edits > 150 chars only
This commit is contained in:
parent
e09f870df4
commit
a7965297bc
|
@ -3,13 +3,16 @@ import { helperContext } from "discourse-common/lib/helpers";
|
|||
export default function (element) {
|
||||
const caps = helperContext().capabilities;
|
||||
|
||||
if (caps.isIOS) {
|
||||
const len = element.value.length;
|
||||
|
||||
// don't scroll to end of element with a lot of text in iOS
|
||||
// it causes composer container to go out of viewport
|
||||
if (caps.isIOS && element.tagName === "TEXTAREA" && len > 150) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.focus();
|
||||
|
||||
const len = element.value.length;
|
||||
element.setSelectionRange(len, len);
|
||||
|
||||
// Scroll to the bottom, in case we're in a tall textarea
|
||||
|
|
Loading…
Reference in New Issue