Skip to content

Commit 7eef2ec

Browse files
committed
Add onClose to props
1 parent 118beb7 commit 7eef2ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ActionButton.js

+9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export default class ActionButton extends Component {
5151
clearTimeout(this.timeout);
5252
}
5353

54+
componentWillReceiveProps(nextProps) {
55+
this.setState({
56+
active: nextProps.active
57+
});
58+
}
59+
5460
getActionButtonStyle() {
5561
return [styles.actionBarItem, this.getButtonSize()];
5662
}
@@ -95,6 +101,7 @@ export default class ActionButton extends Component {
95101
}).start();
96102

97103
setTimeout(() => {
104+
this.props.onClose();
98105
this.setState({ active: false });
99106
}, 250);
100107
}
@@ -266,6 +273,7 @@ ActionButton.propTypes = {
266273
autoInactive: PropTypes.bool,
267274
onPress: PropTypes.func,
268275
onOverlayPress: PropTypes.func,
276+
onClose: PropTypes.func,
269277
backdrop: PropTypes.oneOfType([
270278
PropTypes.bool,
271279
PropTypes.object,
@@ -290,6 +298,7 @@ ActionButton.defaultProps = {
290298
autoInactive: true,
291299
onPress: () => {},
292300
onOverlayPress: () => {},
301+
onClose: () => {},
293302
backdrop: false,
294303
degrees: 135,
295304
size: 63,

0 commit comments

Comments
 (0)