UNPKG

@compactjs/chatscroll

Version:
3 lines (2 loc) 520 B
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((e=e||self).chatscroll={})}(this,function(e){e.observe=function(e){var o=new MutationObserver(function(){var o;(o=e).offsetHeight>=o.scrollHeight||("function"==typeof o.scroll?o.scroll({top:o.scrollHeight,behavior:"smooth"}):o.scrollTop=o.scrollHeight)});return o.observe(e,{childList:!0,subtree:!0}),{detach:function(){o.disconnect()}}}}); //# sourceMappingURL=index.umd.js.map