Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Accordion: don't toggle open class when is-open is undefined #4385

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
scope.openClass = attrs.openClass || 'panel-open';
scope.panelClass = attrs.panelClass;
scope.$watch('isOpen', function(value) {
element.toggleClass(scope.openClass, value);
element.toggleClass(scope.openClass, Boolean(value));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to !!value - the reason is because the Boolean constructor can be overridden by the user, whereas using !! to force to a Boolean cannot be overridden.

if (value) {
accordionCtrl.closeOthers(scope);
}
Expand Down