Skip to content

Commit

Permalink
feat(Modal): add scrollable prop
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbegley committed Mar 8, 2019
1 parent 1e2dc5b commit c8b76cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/lib/Components/ModalsPage.js
Expand Up @@ -69,6 +69,8 @@ const ModalsPage = () => {
PropTypes.bool,
PropTypes.oneOf(['static'])
]),
// if body of modal should be scrollable when content is long
scrollable: PropTypes.bool,
// allows for a node/component to exist next to the modal (outside of it). Useful for external close buttons
// external: PropTypes.node,
// called on componentDidMount
Expand Down
3 changes: 3 additions & 0 deletions src/Modal.js
Expand Up @@ -21,6 +21,7 @@ const propTypes = {
isOpen: PropTypes.bool,
autoFocus: PropTypes.bool,
centered: PropTypes.bool,
scrollable: PropTypes.bool,
size: PropTypes.string,
toggle: PropTypes.func,
keyboard: PropTypes.bool,
Expand Down Expand Up @@ -64,6 +65,7 @@ const defaultProps = {
isOpen: false,
autoFocus: true,
centered: false,
scrollable: false,
role: 'dialog',
backdrop: true,
keyboard: true,
Expand Down Expand Up @@ -318,6 +320,7 @@ class Modal extends React.Component {
className={mapToCssModules(classNames(dialogBaseClass, this.props.className, {
[`modal-${this.props.size}`]: this.props.size,
[`${dialogBaseClass}-centered`]: this.props.centered,
[`${dialogBaseClass}-scrollable`]: this.props.scrollable,
}), this.props.cssModule)}
role="document"
ref={(c) => {
Expand Down

0 comments on commit c8b76cc

Please sign in to comment.