vodkabears / Remodal

No longer actively maintained.
http://vodkabears.github.io/remodal/
MIT License
2.75k stars 771 forks source link

add appendTo option #238

Closed deyceg closed 8 years ago

deyceg commented 8 years ago

Attach Remodal wrapper DOM element to something other than document.body.

The reasoning behind this is that in component based UI's using libraries like React in real-world applications it is necessary to integrate 3rd party DOM manipulation libraries with the component architecture and lifecycle. Not being able to attach the modal to a component violates principles behind component based UI design by bleeding abstractions across components and will make your application more difficult to reason about and test.

It is recommended that the DOM that is rendered by react should not be mutated otherwise when it comes to re-render the component it cannot reconcile the differences and throws an error. There are some circumstances where it is acceptable, and by making this change we can use the Remodal library in component-based UI's by simply opening and closing the modal in the lifecycle hooks.

esbanarango commented 8 years ago

@VodkaBears is there any plan for merging this PR? We also have an Ember addon (ember-remodal) where this PR would be REALLY helpful.

Thank you guys (@VodkaBears && @deyceg)