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
When one modal is closed and another is immediately opened the right padding that is added for the scrollbar width is added to the body when the second modal is closed.
What should be happening?
The original right padding value for the body should be applied when the second modal is closed.
Steps to reproduce issue
Create two modals, 'a' and 'b'.
Set modal 'a' isOpen to true and modal 'b' isOpen to false.
Set modal 'a' isOpen to false and modal 'b' isOpen to true.
Set modal 'b' isOpen to 'false'.
Code
importReact,{useState}from"react";import"bootstrap/dist/css/bootstrap.min.css";import{Button,Container,Modal}from"reactstrap";functionApp(){const[firstModalOpen,setFirstModalOpen]=useState(false);const[secondModalOpen,setSecondModalOpen]=useState(false);return(<divclassName="overflow-scroll bg-primary vh-100"><divclassName="h-100"><ButtononClick={()=>setFirstModalOpen(true)}>Open</Button><ModalisOpen={firstModalOpen}><ButtononClick={()=>{setFirstModalOpen(false);setSecondModalOpen(true);}}>
open second modal
</Button></Modal><ModalisOpen={secondModalOpen}><ButtononClick={()=>setSecondModalOpen(false)}>Close</Button></Modal></div><div>overflow content</div></div>);}exportdefaultApp;
Issue description
Modal
master
umd/csj/es
17.0.2
5.3.1
What is happening?
When one modal is closed and another is immediately opened the right padding that is added for the scrollbar width is added to the body when the second modal is closed.
What should be happening?
The original right padding value for the body should be applied when the second modal is closed.
Steps to reproduce issue
isOpen
totrue
and modal 'b'isOpen
tofalse
.isOpen
tofalse
and modal 'b'isOpen
totrue
.isOpen
to 'false'.Code
https://codesandbox.io/s/reactstrap-modal-padding-bug-flrzt5?file=/src/App.js
The text was updated successfully, but these errors were encountered: