Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ __note__: React bootstrap modal is compatible with bootstrap __3.3.4+__ if you w
var Modal = require('react-bootstrap-modal')

class ModalExample extends React.Component {
constructor(props) {
super(props)
this.state = { open: false }
}

render(){
let closeModal = () => this.setState({ open: false })
Expand All @@ -29,7 +33,7 @@ class ModalExample extends React.Component {

return (
<div>
<button type='button'>Launch modal</button>
<button type='button' onClick={() => this.setState({ open: true })}>Launch modal</button>

<Modal
show={this.state.open}
Expand Down
3 changes: 2 additions & 1 deletion src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ class Modal extends React.Component {
dialog: {
zIndex: getZIndex('modal'),
paddingRight: bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth() : void 0,
paddingLeft: !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth() : void 0
paddingLeft: !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth() : void 0,
display: 'block'
},
backdrop: {
zIndex: getZIndex('backdrop')
Expand Down