Comments (8)
The same happened to me. Did you managed to fix this? Also there are 2 scrollbars when scrolling (one for the modal and one for the page). Any ideas?
from react-modal.
anyone found a solution for this? I'm having this issue as well, having multiple scrollbars.
from react-modal.
Remove this line did the trick:
https://github.com/reactjs/react-modal/blob/master/lib/components/ModalPortal.js#L187
from react-modal.
Or less hacky way:
@jonaswindey @risonsimon @ekonstantinidis
<Modal className="Modal__Bootstrap modal-dialog"
style={styles}>
</Modal>
const styles = {
content: {
position: null,
top: null,
left: null,
right: null,
bottom: null,
border: null,
background: null,
overflow: null,
WebkitOverflowScrolling: null,
borderRadius: null,
padding: null
}
}
from react-modal.
👍
from react-modal.
@hustlzp this do not work when you have a navbar, do you know how to fix this?
from react-modal.
There hasn't been much traction on this issue in almost a year. I'm assuming that this is no longer an issue. If it is, please feel free to re-open.
from react-modal.
This issue still exists. In the docs it's mentioned that className
and/or overlayClassName
need to be set so the respective components don't get passed default styles. Docs
In the example, they set className
to "Modal__Bootstrap" which doesn't correspond to any defined style, but does the job of removing default style from the component. However, they don't set overlayClassName
so the overlay gets the default style. We could set overlayClassName
to "ReactModal__Overlay" but we still need to fix the CSS.
// component.js
<Modal
className="Modal__Bootstrap modal-dialog"
overlayClassName="ReactModal__Overlay" // ADD THIS
isOpen={this.state.modalIsOpen}
>
...
// style.css
.ReactModal__Overlay {
-webkit-perspective: 600;
perspective: 600;
opacity: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: rgba(0, 0, 0, 0.5);
position: fixed; // ADD MISSING
inset: 0px // ADD MISSING
}
...
from react-modal.
Related Issues (20)
- Replace focus trap with `inert` HOT 1
- Focus on the input element is lost when trying to scroll modal content by dragging scrollbar
- Focus trap incorrectly finds tabbable elements HOT 11
- Modal doesn't close on the first click on the overlay after click on elements containing event.stopPropagation() inside modal HOT 11
- Add support for React & Node 18 (as easy as adding startTransition() on each setState) HOT 18
- When I try to apply css variables from css modules in React, nothing is passed HOT 9
- Npm start related issue
- Why convert position property to inset? HOT 2
- Analysis: 90% of dependency updates in this repository can be merged.
- Should use event.key not event.code
- How can i make the modal overlay non blocking? HOT 2
- Resize error when moving tab around HOT 2
- Display blurry when elements with position attributes and have scrollbars. HOT 3
- Close the modal window on the first click when using stopPropagation() HOT 3
- Moving to a "modern" build system (hardcore level) HOT 6
- Refactor react-modal to use TypeScript HOT 1
- Replace Karma (now deprecated) with a new test runner HOT 6
- Runtime error when tabbing elements where shadowDom is a document fragment rather than an element
- Consider dropping support for React versions <= v16 HOT 3
- Avoid Scroll position being kept HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-modal.