Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent default jquery-ui tab behaviour when using keyboard navigation

Tags:

tabs

jquery-ui

I'm using jquery-ui tabs and jeditable to inline edit the tab title. But navigating with the cursors in the editable text leads jquery-ui to navigate to the tab next to it.

How can i prevent the jquery default behaviour (disable keyboad navigation in tabs).

Cheers, Broncko

like image 667
Broncko Avatar asked Apr 09 '13 07:04

Broncko


1 Answers

Solved it by:

$.widget( "ui.tabs", $.ui.tabs, {
    options: {
      keyboard: true
    },
    _tabKeydown: function(e) {
      if(this.options.keyboard) {
        this._super( '_tabKeydown' );
      } else {
        return false;
      }
    }
});
like image 133
Broncko Avatar answered Sep 21 '22 12:09

Broncko