Answer the question
In order to leave comments, you need to log in
How to add changes to css file?
In a React app, I have a calendar (react-data-picker). But it opens behind other elements on the page. To do this, you need to change its z-index.
I have a style.scss file that has the imports added:
@import 'display';
@import 'table';
@import 'footer';
...
.react-datepicker-popper {
z-index: 100;
}
...
@import 'datapicker';
npm run build
Answer the question
In order to leave comments, you need to log in
I solved the problem by adding a property to the component directly in the component:
const customStyles = {
zIndex: 100
};
class FormReport extends Component {
constructor(props) {
super(props);
}
render() {
return (
...
<div style={customStyles}>
<DatePicker style={customStyles}/>
</div>
...
)}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question