Space bar closes accordian

Space bar closes accordian

Hi Guys,

Pretty new to jquery so any help here would be appreciated.

I have a text input tag in my <a> that toggles the accordian. This input allows me to edit the title of the tab and is triggered by an edit/save span. When I chick edit the title of the accordian is entered in the input tag. The problem occurs when the user presses the space bar when editing the text. The accordian slides up and no space is entered in the input field.

Is the space bar used as a trigger to close the tab? It is not defined anywhere in my accordian set up...

$('#accordion li').click(function () {  
 
        /* FIRST SECTION */ 
 
        //slideup or hide all the Submenu  
        $('#accordion li').children('ul').slideUp('fast');    
              
        //remove all the "Over" class, so that the arrow reset to default  
        $('#accordion li > a').each(function () {  
            if ($(this).attr('rel')!='') {  
                $(this).removeClass($(this).attr('rel') + ' Over');    
            }  
        });  
              
        /* SECOND SECTION */      
              
        //show the selected submenu  
        $(this).children('ul').slideDown('fast');  
              
        //add "Over" class, so that the arrow pointing down  
        $(this).children('a').addClass($(this).children('li a').attr('rel') + 'Over');            
 
        return false;  
    });