react-modal-dialog
react-modal-dialog copied to clipboard
Is there a way to send a custom class to closeButton?
@AlexandraKim for now as I see - there is no ability to put custom class directly to closeButton. But I solve this by adding class: <ModalDialog className='custom-modal'>
and then just use CSS(SCSS)
.custom-modal {
/*override here container rules*/
[class^='closeButton'] {
display: none;
}
}
@qimingweng but I reach this issue when I want to create a new one about adding prop for show/hide native close button. Maybe in some days after I create own PR.
What's the use case here?
If you want no close button or a different close button, I would suggest copying the code from ModalDialog.js
and creating a new type of Dialog!
@qimingweng this way isn't ok for me personally. I install it by npm and I don't want to change sourсe code.
I agree with @m1n0s. You should be able to just hide the Close button Copying it would mean having to npm install all
'classnames';
'dynamics.js';
'react-center-component';
'active-event-stack';
'keycode';
'narcissus';
Which I don't want because it would only pollute my project