Comparing version 0.0.15 to 0.0.16
@@ -145,3 +145,5 @@ 'use strict'; | ||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | ||
this.update(nextProps); | ||
if (this.props.activeKey !== nextProps.activeKey) { | ||
this.update(nextProps); | ||
} | ||
}, | ||
@@ -148,0 +150,0 @@ render: function render() { |
@@ -73,2 +73,3 @@ 'use strict'; | ||
handleDocumentClick: function handleDocumentClick(event) { | ||
if (event[this._suppressRootId]) { | ||
@@ -75,0 +76,0 @@ return; |
{ | ||
"name": "rsuite", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "RSuite components built with React", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -104,3 +104,5 @@ import React from 'react'; | ||
componentWillReceiveProps(nextProps) { | ||
this.update(nextProps); | ||
if (this.props.activeKey !== nextProps.activeKey) { | ||
this.update(nextProps); | ||
} | ||
}, | ||
@@ -123,48 +125,48 @@ render() { | ||
let Toggle = ( | ||
<DropdownToggle | ||
{...props} | ||
onClick = {this.handleClick} | ||
> | ||
{this.state.title || title } | ||
</DropdownToggle> | ||
); | ||
let Toggle = ( | ||
<DropdownToggle | ||
{...props} | ||
onClick = {this.handleClick} | ||
> | ||
{this.state.title || title } | ||
</DropdownToggle> | ||
); | ||
let Menu = ( | ||
<DropdownMenu | ||
onClose={this.toggle} | ||
onSelect={this.handleSelect} | ||
activeKey={this.state.activeKey} | ||
style={menuStyle} | ||
ref='menu' | ||
> | ||
{children} | ||
</DropdownMenu> | ||
); | ||
let Menu = ( | ||
<DropdownMenu | ||
onClose={this.toggle} | ||
onSelect={this.handleSelect} | ||
activeKey={this.state.activeKey} | ||
style={menuStyle} | ||
ref='menu' | ||
> | ||
{children} | ||
</DropdownMenu> | ||
); | ||
if (this.state.open) { | ||
Menu = ( | ||
<RootCloseWrapper onRootClose={this.toggle}> | ||
{Menu} | ||
</RootCloseWrapper> | ||
); | ||
} | ||
if (this.state.open) { | ||
Menu = ( | ||
<RootCloseWrapper onRootClose={this.toggle}> | ||
{Menu} | ||
</RootCloseWrapper> | ||
); | ||
} | ||
const classes = classNames({ | ||
'dropdown': !dropup, | ||
'dropup': dropup, | ||
'both-ends': bothEnds, | ||
'open': this.state.open | ||
}, className); | ||
const classes = classNames({ | ||
'dropdown': !dropup, | ||
'dropup': dropup, | ||
'both-ends': bothEnds, | ||
'open': this.state.open | ||
}, className); | ||
return ( | ||
<Component | ||
{...props} | ||
className = {classes} | ||
role = "dropdown" | ||
> | ||
{Toggle} | ||
{Menu} | ||
</Component> | ||
); | ||
return ( | ||
<Component | ||
{...props} | ||
className = {classes} | ||
role = "dropdown" | ||
> | ||
{Toggle} | ||
{Menu} | ||
</Component> | ||
); | ||
} | ||
@@ -171,0 +173,0 @@ }); |
@@ -57,2 +57,3 @@ /** | ||
handleDocumentClick(event) { | ||
if (event[this._suppressRootId]) { | ||
@@ -59,0 +60,0 @@ return; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13191
827202