react-restart / ui

MIT License
132 stars 22 forks source link

fix(Modal,Overlay): elements exit according to their transition #72

Closed jquense closed 1 year ago

jquense commented 1 year ago

This updates the Modal and Overlay components to exit more consistently according to their transitions. Previously the Modal would unmount as soon as it's dialog transition exited, even if the backdrop one had not finished. Originally i tried to exit when both were done, but actually that doesn't seem like the right behavior, bc you want each component to unmount as soon as it can.

This also simplifies the logic a bit because we can leave the unmounting up to the consumer if they want to disregard our props. I also was able to remove the !hasTransition cases by using NoopTransition.