Skip to content

Commit 4f03ac2

Browse files
committed
Accordion: Don't stop propagation when clicking in headers. Fixes #4732 - accordion steals header clicks.
1 parent c0ba6cc commit 4f03ac2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/ui.accordion.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ $.widget("ui.accordion", {
101101
this.headers.find('a').attr('tabIndex','-1');
102102

103103
if (o.event) {
104-
this.headers.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event, this); });
104+
this.headers.bind((o.event) + ".accordion", function(event) {
105+
self._clickHandler.call(self, event, this);
106+
event.preventDefault();
107+
});
105108
}
106109

107110
},
@@ -181,7 +184,8 @@ $.widget("ui.accordion", {
181184
break;
182185
case keyCode.SPACE:
183186
case keyCode.ENTER:
184-
return this._clickHandler({ target: event.target }, event.target);
187+
this._clickHandler({ target: event.target }, event.target);
188+
event.preventDefault();
185189
}
186190

187191
if (toFocus) {
@@ -246,7 +250,7 @@ $.widget("ui.accordion", {
246250
_clickHandler: function(event, target) {
247251

248252
var o = this.options;
249-
if (o.disabled) return false;
253+
if (o.disabled) { return; }
250254

251255
// called only when using activate(false) to close all parts programmatically
252256
if (!event.target && o.collapsible) {
@@ -263,7 +267,7 @@ $.widget("ui.accordion", {
263267
},
264268
toShow = (this.active = $([]));
265269
this._toggle(toShow, toHide, data);
266-
return false;
270+
return;
267271
}
268272

269273
// get the click target
@@ -272,7 +276,7 @@ $.widget("ui.accordion", {
272276

273277
// if animations are still active, or the active header is the target, ignore click
274278
if (this.running || (!o.collapsible && clickedIsActive)) {
275-
return false;
279+
return;
276280
}
277281

278282
// switch classes
@@ -299,7 +303,7 @@ $.widget("ui.accordion", {
299303
this.active = clickedIsActive ? $([]) : clicked;
300304
this._toggle(toShow, toHide, data, clickedIsActive, down);
301305

302-
return false;
306+
return;
303307

304308
},
305309

0 commit comments

Comments
 (0)