about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorNolan Lawson <nolan@nolanlawson.com>2017-05-26 05:09:13 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-05-26 14:09:13 +0200
commit2531c5953ba4048b04b3c47de345eeac25c05a5f (patch)
tree0fce0efc048e88b2d21ec864b2966e86f9d2fc10 /app/javascript
parentc6db416ff70724cd19898fdc91feac6f539b10f3 (diff)
Replace onWheel listener with onScroll (#3324)
* Replace onWheel listener with onScroll

* Update column.js
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/ui/components/column.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/mastodon/features/ui/components/column.js b/app/javascript/mastodon/features/ui/components/column.js
index 6a8f02bb8..e8973f595 100644
--- a/app/javascript/mastodon/features/ui/components/column.js
+++ b/app/javascript/mastodon/features/ui/components/column.js
@@ -1,6 +1,7 @@
 import React from 'react';
 import ColumnHeader from './column_header';
 import PropTypes from 'prop-types';
+import { debounce } from 'lodash';
 
 const easingOutQuint = (x, t, b, c, d) => c*((t=t/d-1)*t*t*t*t + 1) + b;
 
@@ -48,11 +49,11 @@ class Column extends React.PureComponent {
     this._interruptScrollAnimation = scrollTop(scrollable);
   }
 
-  handleWheel = () => {
+  handleScroll = debounce(() => {
     if (typeof this._interruptScrollAnimation !== 'undefined') {
       this._interruptScrollAnimation();
     }
-  }
+  }, 200)
 
   setRef = (c) => {
     this.node = c;
@@ -74,7 +75,7 @@ class Column extends React.PureComponent {
         role='region'
         aria-labelledby={columnHeaderId}
         className='column'
-        onWheel={this.handleWheel}>
+        onScroll={this.handleScroll}>
         {header}
         {children}
       </div>