Skip to content

Commit

Permalink
Merge pull request #3424 from Icinga/fix/do-not-mangle-cursor-positio…
Browse files Browse the repository at this point in the history
…n-in-forms-3348

Do not mangle cursor position in forms
  • Loading branch information
lippserd authored Apr 24, 2018
2 parents c566c8b + 9857021 commit af75c43
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions public/js/icinga/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit af75c43

Please sign in to comment.