Merge pull request #3424 from Icinga/fix/do-not-mangle-cursor-position-in-forms-3348

Do not mangle cursor position in forms
This commit is contained in:
Eric Lippmann 2018-04-24 10:16:46 -04:00 committed by GitHub
commit af75c43a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 9 deletions

View File

@ -857,15 +857,6 @@
if ($activeElement.length && $activeElement.is(':visible')) {
$activeElement.focus();
if ($activeElement.is('input[type=text]')) {
if (typeof $activeElement[0].setSelectionRange === 'function') {
// Place focus after the last character. Could be extended to other
// input types, would require some \r\n "magic" to work around issues
// with some browsers
var len = $activeElement.val().length;
$activeElement[0].setSelectionRange(len, len);
}
}
} else if (! autorefresh) {
if (focusFallback) {
$(focusFallback.parent).find(focusFallback.child).focus();