mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-12 22:15:55 +00:00
brewRenderer: Capture event properties while still in event loop.
React [pools events](https://github.com/facebook/react/issues/2850), which means that once the lambda runs later on the properties we want to read will be null. Instead, we capture the properties in the event loop.
This commit is contained in:
@@ -58,8 +58,9 @@ const BrewRenderer = createClass({
|
||||
},
|
||||
|
||||
handleScroll : function(e){
|
||||
let target = e.target;
|
||||
this.setState((prevState)=>({
|
||||
viewablePageNumber : Math.floor(e.target.scrollTop / e.target.scrollHeight * prevState.pages.length)
|
||||
viewablePageNumber : Math.floor(target.scrollTop / target.scrollHeight * prevState.pages.length)
|
||||
}));
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user