I see in jQuery UI accordian you can use the space bar to toggle active headers. How can one disable this? I don\'t want the user to use keyboard to interact with the accord
I developed an answer to just enabling the spacebar, but it could be expanded for other keydown events you want to override.
/*
* Detect spacebar and return immediately, otherwise call standard behaviour
* The 'solution' of deleting the event handler caused other errors
* http://stackoverflow.com/a/7008791
*/
$.ui.accordion.prototype._originalKeyDown = $.ui.accordion.prototype._keydown;
$.ui.accordion.prototype._keydown = function( event ) {
var keyCode = $.ui.keyCode;
if (event.keyCode == keyCode.SPACE) {
return;
}
// call the original method
this._originalKeyDown(event);
};