Explorar o código

add scrollTop to ui/components/column (#4563)

Ondřej Hruška %!s(int64=6) %!d(string=hai) anos
pai
achega
820099813f
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      app/javascript/mastodon/features/ui/components/column.js

+ 11 - 0
app/javascript/mastodon/features/ui/components/column.js

@@ -25,6 +25,17 @@ export default class Column extends React.PureComponent {
     this._interruptScrollAnimation = scrollTop(scrollable);
   }
 
+  scrollTop () {
+    const scrollable = this.node.querySelector('.scrollable');
+
+    if (!scrollable) {
+      return;
+    }
+
+    this._interruptScrollAnimation = scrollTop(scrollable);
+  }
+
+
   handleScroll = debounce(() => {
     if (typeof this._interruptScrollAnimation !== 'undefined') {
       this._interruptScrollAnimation();