After installing the AJAX Extensions 1.0 for the 2.0 Framework I started noticing odd behavior in Firefox. Specifically hitting enter in a textarea resulted in a postback rather than a new line. When testing on a machine that does not have the AJAX Extensions installed I do not encounter an error. Upon further inspection it looks like the WebForm_FireDefaultButton method is not the same on the two machines. On the working machine it looks like:
function WebForm_FireDefaultButton(event, target) {
if (event.keyCode == 13) {
var src = event.srcElement || event.target;
if (!src || (src.tagName.toLowerCase() != "textarea")) {
var defaultButton;
if (__nonMSDOMBrowser) {
defaultButton = document.getElementById(target);
}
else {
defaultButton = document.all[target];
}
if (defaultButton && typeof(defaultButton.click) != "undefined") {
defaultButton.click();
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return false;
}
}
}
return true;
}
on the machine that has the AJAX Extensions installed it is as follows:
function WebForm_FireDefaultButton(event, target) {
if (event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea"))) {
var defaultButton;
if (__nonMSDOMBrowser) {
defaultButton = document.getElementById(target);
}
else {
defaultButton = document.all[target];
}
if (defaultButton && typeof(defaultButton.click) != "undefined") {
defaultButton.click();
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return false;
}
}
return true;
}
I believe Firefox does not support event.srcElement and that is why the first method also checks even.target. Has the AJAX Extension reintroduced an old browser incompatibility into the Framework? Is this a known issue? If so is there a fix other than including my own javascript?