react-restart / ui

MIT License
132 stars 22 forks source link

Add data-top attribute to modals #67

Closed martinadamec closed 2 years ago

martinadamec commented 2 years ago

Last opened modal has data attr data-top="true", rest has data-top="false". When the top modal is closed, the previous one receive attr data-top="true".

It is helpfull for nested modals, you can select the top modal and the rest modals by CSS clasess.

.modal.show[data-top="true"] {}
.modal.show[data-top="false"] {}

I really appreciate, if you approve these changes, or modify with the same result. Thank you!

martinadamec commented 2 years ago

It is possible to do by override methods like is it mention here https://github.com/react-bootstrap/react-bootstrap/issues/6472