Skip to content

Commit

Permalink
fix(edit): fix for Chrome and numeric inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
swalters committed Aug 6, 2015
1 parent 486433b commit 7d8af94
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/features/edit/js/gridEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,15 @@
$elm[0].select();
}
else {
$elm[0].setSelectionRange($elm[0].value.length, $elm[0].value.length);
//some browsers (Chrome) stupidly, imo, support the w3 standard that number, email, ...
//fields should not allow setSelectionRange. We ignore the error for those browsers
//https://www.w3.org/Bugs/Public/show_bug.cgi?id=24796
try {
$elm[0].setSelectionRange($elm[0].value.length, $elm[0].value.length);
}
catch (ex) {
//ignore
}
}
});

Expand Down

0 comments on commit 7d8af94

Please sign in to comment.