Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react modal scroll 2 overlapping components

Since the modal is absolutely positioned, it is out of the document bounds, in other words the document, does not know how big the modal is and has no idea that it is bigger than the document itself and therefore doesn't scroll.

This can be fixed by giving the modal a fixed height and setting the overflow property to scroll. Try the code below, I just tested it and it works perfectly.

    var customStyles = {
      content : {
        top: '50%',
        left: '50%',
        right: 'auto',
        bottom: 'auto',
        marginRight: '-50%',
        transform: 'translate(-50%, -50%)',
        height: '500px', // <-- This sets the height
        overlfow: 'scroll' // <-- This tells the modal to scrol
      }
    };
Comment

PREVIOUS NEXT
Code Example
Javascript :: reduceat 
Javascript :: tictactoe - javascript 
Javascript :: add validation in strapi 
Javascript :: select not input elements text JS 
Javascript :: go back to screen with params react native 
Javascript :: build function component react 
Javascript :: Day of The Year 
Javascript :: multiple question node js 
Javascript :: comparing oblects 
Javascript :: Answer the following questions by identifying what unit of measurement to be used. 2pts. Brainly 
Javascript :: forward slash in ajax url 
Javascript :: how to send data from form with post axios in nuxt 
Javascript :: how to empty nodeList 
Javascript :: Decimal Base Exponent shorthand javascript 
Javascript :: reactRender 
Javascript :: alert(document.cookie); 
Javascript :: Lisk Schema example 
Javascript :: One component overlapping on other in react.js app 
Javascript :: data toggle modal and tooltip 
Javascript :: Error: Node Sass version 7.0.1 is incompatible with ^4.0.0. angular 
Javascript :: rnpm react-images-uploading 
Javascript :: request body goes undefined in nodejs mongodb 
Javascript :: javascript grow function 
Javascript :: useHistory: useNavigate if you install v6 or more than react-router-dom": ^6.2.1 
Javascript :: typeorm caching queries time limit by id 
Javascript :: extra reducer 
Javascript :: regex match caret 
Javascript :: Renaming props in react 
Javascript :: prevent the fire of parent event listener 
Javascript :: get text 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =