diff --git a/addons/mail/static/src/components/chatter/chatter.js b/addons/mail/static/src/components/chatter/chatter.js index 42462e930f9..3f6ca7dca41 100644 --- a/addons/mail/static/src/components/chatter/chatter.js +++ b/addons/mail/static/src/components/chatter/chatter.js @@ -47,10 +47,16 @@ class Chatter extends Component { * Reference of the composer. Useful to focus it. */ this._composerRef = useRef('composer'); + /** + * Reference of the scroll Panel (Real scroll element). Useful to pass the Scroll element to + * child component to handle proper scrollable element. + */ + this._scrollPanelRef = useRef('scrollPanel'); /** * Reference of the message list. Useful to trigger the scroll event on it. */ this._threadRef = useRef('thread'); + this.getScrollableElement = this.getScrollableElement.bind(this); } //-------------------------------------------------------------------------- @@ -64,6 +70,16 @@ class Chatter extends Component { return this.env.models['mail.chatter'].get(this.props.chatterLocalId); } + /** + * @returns {Element|undefined} Scrollable Element + */ + getScrollableElement() { + if (!this._scrollPanelRef.el) { + return; + } + return this._scrollPanelRef.el; + } + //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- diff --git a/addons/mail/static/src/components/chatter/chatter.xml b/addons/mail/static/src/components/chatter/chatter.xml index ffb27244471..d9cf20b478e 100644 --- a/addons/mail/static/src/components/chatter/chatter.xml +++ b/addons/mail/static/src/components/chatter/chatter.xml @@ -24,7 +24,7 @@ /> -