You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(Modal): onOpened and onClosed callbacks for modals (#434)
add onOpened and onClosed callbacks for modals
fix logic for where new props are called. re-label methods to align with purpose
Closes#306
Breaks Modal onEnter and onExit props are not longer based on when the modal is opened and closed, they are based on when the component mounts and unmounts. onOpened and onClosed are now used for when the modal opens and closes.
// callback for toggling isOpen in the controlling component
49
+
isOpen: PropTypes.bool,
50
+
autoFocus: PropTypes.bool,
52
51
size: PropTypes.string,
52
+
// callback for toggling isOpen in the controlling component
53
+
toggle: PropTypes.func,
54
+
keyboard: PropTypes.bool,
53
55
// control backdrop, see http://v4-alpha.getbootstrap.com/components/modal/#options
54
56
backdrop: PropTypes.oneOfType([
55
57
PropTypes.bool,
56
58
PropTypes.oneOf(['static'])
57
59
]),
58
-
keyboard: PropTypes.bool,
59
-
// zIndex defaults to 1000.
60
-
zIndex: PropTypes.oneOfType([
61
-
PropTypes.number,
62
-
PropTypes.string,
63
-
]),
60
+
// called on componentDidMount
61
+
onEnter: PropTypes.func,
62
+
// called on componentWillUnmount
63
+
onExit: PropTypes.func,
64
+
onOpened: PropTypes.func,
65
+
onClosed: PropTypes.func,
64
66
className: PropTypes.string,
65
67
wrapClassName: PropTypes.string,
66
68
modalClassName: PropTypes.string,
67
69
backdropClassName: PropTypes.string,
68
70
contentClassName: PropTypes.string,
69
71
// boolean to control whether the fade transition occurs (default: true)
70
72
fade: PropTypes.bool,
71
-
// modalTransitionTimeout - controls appear, enter, and leave (default: 300)
72
-
// If you need different values for appear v. enter v. leave, use the more
73
-
// specific props like modalTransitionAppearTimeout.
74
-
modalTransitionTimeout: PropTypes.number,
75
-
modalTransitionAppearTimeout: PropTypes.number,
76
-
modalTransitionEnterTimeout: PropTypes.number,
77
-
modalTransitionLeaveTimeout: PropTypes.number,
73
+
cssModule: PropTypes.object,
74
+
// zIndex defaults to 1000.
75
+
zIndex: PropTypes.oneOfType([
76
+
PropTypes.number,
77
+
PropTypes.string,
78
+
]),
78
79
// backdropTransitionTimeout - controls appear, enter, and leave (default: 150)
79
80
// If you need different values for appear v. enter v. leave, use the more
80
81
// specific props like backdropTransitionAppearTimeout.
0 commit comments