pradel / react-responsive-modal

Simple responsive react modal
https://react-responsive-modal.leopradel.com/
MIT License
606 stars 95 forks source link

Is it possible to add an option to make this modal modeless ? #461

Closed RossVertizan closed 3 years ago

RossVertizan commented 3 years ago

Feature request

Add an option so that the modal is modeless, allowing interaction with other UI elements to occur.

Is your feature request related to a problem? Please describe.

I have a use case in my app where I need to interact with an underlying UI element to allow the selection of blocks in a diagram. The modal works fine for me in all other cases, but in this case, I need it to not be modal, i.e. modeless. I don't know how hard this would be to implement.

Describe the solution you'd like

My preferred solution would be a boolean property, "modal", which defaults to true, but when set to false would allow interaction with other UI elements.

I hope this is clear.

Many thanks in advance for your consideration of this enhancement.

pradel commented 3 years ago

@RossVertizan thanks for raising this issue, I played a bit with it to see how this could work. But I wasn't able to find a solution to still have the modal and allow interactions in the background to occur. It looks like this would require the dom of the modal to change a lot (and not sure that it's still possible to have the modal centered after this). As it's a really specific use case that you have for this one, this is not something I really want to do as it will introduce a lot of complexity in the package (meaning bigger bundle size) affecting all the users. But if you have an idea how to do this simply, feel free to send a pr and I will gladly review it :)