mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #2387 from fabiomcosta/avoid_double_scrollread
avoid reading the scroll position twice
This commit is contained in:
@@ -11,16 +11,13 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var getUnboundedScrollPosition = require('getUnboundedScrollPosition');
|
||||
|
||||
var ViewportMetrics = {
|
||||
|
||||
currentScrollLeft: 0,
|
||||
|
||||
currentScrollTop: 0,
|
||||
|
||||
refreshScrollValues: function() {
|
||||
var scrollPosition = getUnboundedScrollPosition(window);
|
||||
refreshScrollValues: function(scrollPosition) {
|
||||
ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
||||
ViewportMetrics.currentScrollTop = scrollPosition.y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user