Permalink
Browse files

Prevent warnings in IE

  • Loading branch information...
1 parent c906d4e commit c5a11e1d180e9c8dbef8d234bd26fb6717e6b6bb @peterjanes committed Feb 9, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 feature-detects/forms-inputnumber-l10n.js
@@ -21,7 +21,10 @@ Modernizr.addTest('localizedNumber', function() {
input = el.childNodes[0];
root.appendChild(el);
input.focus();
- doc.execCommand('InsertText', false, '1,1');
+ try {
+ doc.execCommand('InsertText', false, '1,1');
+ } catch(e) { // prevent warnings in IE
+ }
diff = input.type === 'number' && input.valueAsNumber === 1.1 && input.checkValidity();
root.removeChild(el);
fake && root.parentNode.removeChild(root);

0 comments on commit c5a11e1

Please sign in to comment.