react-window 1.8.5 → 1.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -208,11 +208,17 @@ function createGridComponent(_ref2) {
208
208
  if (itemStyleCache.hasOwnProperty(key)) {
209
209
  style = itemStyleCache[key];
210
210
  } else {
211
- var _style;
212
-
213
- itemStyleCache[key] = style = (_style = {
214
- position: 'absolute'
215
- }, _style[direction === 'rtl' ? 'right' : 'left'] = getColumnOffset(_this.props, columnIndex, _this._instanceProps), _style.top = getRowOffset(_this.props, rowIndex, _this._instanceProps), _style.height = getRowHeight(_this.props, rowIndex, _this._instanceProps), _style.width = getColumnWidth(_this.props, columnIndex, _this._instanceProps), _style);
211
+ var _offset = getColumnOffset(_this.props, columnIndex, _this._instanceProps);
212
+
213
+ var isRtl = direction === 'rtl';
214
+ itemStyleCache[key] = style = {
215
+ position: 'absolute',
216
+ left: isRtl ? undefined : _offset,
217
+ right: isRtl ? _offset : undefined,
218
+ top: getRowOffset(_this.props, rowIndex, _this._instanceProps),
219
+ height: getRowHeight(_this.props, rowIndex, _this._instanceProps),
220
+ width: getColumnWidth(_this.props, columnIndex, _this._instanceProps)
221
+ };
216
222
  }
217
223
 
218
224
  return style;
@@ -1099,16 +1105,21 @@ function createListComponent(_ref) {
1099
1105
  if (itemStyleCache.hasOwnProperty(index)) {
1100
1106
  style = itemStyleCache[index];
1101
1107
  } else {
1102
- var _style;
1103
-
1104
1108
  var _offset = getItemOffset(_this.props, index, _this._instanceProps);
1105
1109
 
1106
1110
  var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction "horizontal"
1107
1111
 
1108
1112
  var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
1109
- itemStyleCache[index] = style = (_style = {
1110
- position: 'absolute'
1111
- }, _style[direction === 'rtl' ? 'right' : 'left'] = isHorizontal ? _offset : 0, _style.top = !isHorizontal ? _offset : 0, _style.height = !isHorizontal ? size : '100%', _style.width = isHorizontal ? size : '100%', _style);
1113
+ var isRtl = direction === 'rtl';
1114
+ var offsetHorizontal = isHorizontal ? _offset : 0;
1115
+ itemStyleCache[index] = style = {
1116
+ position: 'absolute',
1117
+ left: isRtl ? undefined : offsetHorizontal,
1118
+ right: isRtl ? offsetHorizontal : undefined,
1119
+ top: !isHorizontal ? _offset : 0,
1120
+ height: !isHorizontal ? size : '100%',
1121
+ width: isHorizontal ? size : '100%'
1122
+ };
1112
1123
  }
1113
1124
 
1114
1125
  return style;