Skip to content

Commit 6fe06fa

Browse files
committed
Tabs: Space toggles, Enter activates.
1 parent 66c371a commit 6fe06fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/jquery.ui.tabs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,18 @@ $.widget( "ui.tabs", {
159159
selectedIndex = 0;
160160
break;
161161
case $.ui.keyCode.SPACE:
162-
case $.ui.keyCode.ENTER:
162+
// toggle (cancel delayed activation, allow collapsing)
163163
event.preventDefault();
164164
clearTimeout( this.activating );
165165
// Determine if we should collapse or activate
166166
this._activate( selectedIndex === this.options.active ? false : selectedIndex );
167167
return;
168+
case $.ui.keyCode.ENTER:
169+
// activate only, no collapsing
170+
event.preventDefault();
171+
clearTimeout( this.activating );
172+
this._activate( selectedIndex );
173+
return;
168174
default:
169175
return;
170176
}

0 commit comments

Comments
 (0)