Skip to content

Commit

Permalink
fix(DropdownToggle): fix 0 value #1496 (#1780)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Sharp <dumbdrum@gmail.com>
  • Loading branch information
hedgecox and TheSharpieOne committed Jun 22, 2020
1 parent ca113f1 commit c4f86d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/DropdownToggle.js
Expand Up @@ -60,7 +60,12 @@ class DropdownToggle extends React.Component {
'nav-link': nav
}
), cssModule);
const children = props.children || <span className="sr-only">{ariaLabel}</span>;
const children =
typeof props.children !== 'undefined' ? (
props.children
) : (
<span className="sr-only">{ariaLabel}</span>
);

let Tag;

Expand Down Expand Up @@ -93,7 +98,7 @@ class DropdownToggle extends React.Component {
<Tag
{...props}
{...{ [typeof Tag === 'string' ? 'ref' : 'innerRef']: ref }}

className={classes}
onClick={this.onClick}
aria-expanded={this.context.isOpen}
Expand Down

0 comments on commit c4f86d5

Please sign in to comment.