diff --git a/CHANGELOG b/CHANGELOG index 83ddcde..bd3235c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Form.Element.activate shouldn't raise an exception when the form or field is hidden. [sam] + * Remove support for "throw $continue" in Enumerable. Use "return" instead. [sam] * Update HEADER to reflect new URL. [sam] diff --git a/src/form.js b/src/form.js index fa2afa3..fc815fb 100644 --- a/src/form.js +++ b/src/form.js @@ -132,10 +132,12 @@ Form.Element.Methods = { activate: function(element) { element = $(element); - element.focus(); - if (element.select && ( element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type) ) ) - element.select(); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) {} return element; }, diff --git a/test/unit/form.html b/test/unit/form.html index 54a7d9e..96a79b4 100644 --- a/test/unit/form.html +++ b/test/unit/form.html @@ -86,6 +86,10 @@ +
+