Skip to content

Commit 7d8af94

Browse files
committed
fix(edit): fix for Chrome and numeric inputs
1 parent 486433b commit 7d8af94

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/features/edit/js/gridEdit.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,15 @@
879879
$elm[0].select();
880880
}
881881
else {
882-
$elm[0].setSelectionRange($elm[0].value.length, $elm[0].value.length);
882+
//some browsers (Chrome) stupidly, imo, support the w3 standard that number, email, ...
883+
//fields should not allow setSelectionRange. We ignore the error for those browsers
884+
//https://www.w3.org/Bugs/Public/show_bug.cgi?id=24796
885+
try {
886+
$elm[0].setSelectionRange($elm[0].value.length, $elm[0].value.length);
887+
}
888+
catch (ex) {
889+
//ignore
890+
}
883891
}
884892
});
885893

0 commit comments

Comments
 (0)