Accessible modal dialog component for React.


. Accessible modal dialog component for React.

Expected behavior React page is large and should scroll to see all the page.

js looks like this, the {modalContent being passed in is basically separate forms in components} import {Avatar, Dropdown, Modal, Navbar} from "flowbite-react"; import { useState } from 'react'; import EditEducation.

Latest version: 3. See it in action in the CodeSandbox Demo. the approach document.

Setting Up the Application.

. . Jan 1, 2023 · the approach document.

. .



Useful for modal and other overlay components. body most of the time.

overflow = 'hidden' in componentDidMount, the component still gets mounted which calls the lifecycle method that hides the scroll on body. By default, the modal portal will be appended to the document's body.

15 hours ago · Inspired by Robby Leonardi.

the approach overflow: hidden on the body or html elements doesn't work for all browsers; the position: fixed approach causes the body scroll to reset.


🔐Body scroll locking that just works with everything. . export class Modal extends React.

. bool. . 1, last published: 7 months ago. .

the approach document.

You can also fork this sandbox and keep building it using our. .


for iOS, need.


Start using body-scroll-lock in your project by running `npm i body-scroll-lock`.