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.cjs.js CHANGED
@@ -214,11 +214,17 @@ function createGridComponent(_ref2) {
214
214
  if (itemStyleCache.hasOwnProperty(key)) {
215
215
  style = itemStyleCache[key];
216
216
  } else {
217
- var _style;
218
-
219
- itemStyleCache[key] = style = (_style = {
220
- position: 'absolute'
221
- }, _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);
217
+ var _offset = getColumnOffset(_this.props, columnIndex, _this._instanceProps);
218
+
219
+ var isRtl = direction === 'rtl';
220
+ itemStyleCache[key] = style = {
221
+ position: 'absolute',
222
+ left: isRtl ? undefined : _offset,
223
+ right: isRtl ? _offset : undefined,
224
+ top: getRowOffset(_this.props, rowIndex, _this._instanceProps),
225
+ height: getRowHeight(_this.props, rowIndex, _this._instanceProps),
226
+ width: getColumnWidth(_this.props, columnIndex, _this._instanceProps)
227
+ };
222
228
  }
223
229
 
224
230
  return style;
@@ -1105,16 +1111,21 @@ function createListComponent(_ref) {
1105
1111
  if (itemStyleCache.hasOwnProperty(index)) {
1106
1112
  style = itemStyleCache[index];
1107
1113
  } else {
1108
- var _style;
1109
-
1110
1114
  var _offset = getItemOffset(_this.props, index, _this._instanceProps);
1111
1115
 
1112
1116
  var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction "horizontal"
1113
1117
 
1114
1118
  var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
1115
- itemStyleCache[index] = style = (_style = {
1116
- position: 'absolute'
1117
- }, _style[direction === 'rtl' ? 'right' : 'left'] = isHorizontal ? _offset : 0, _style.top = !isHorizontal ? _offset : 0, _style.height = !isHorizontal ? size : '100%', _style.width = isHorizontal ? size : '100%', _style);
1119
+ var isRtl = direction === 'rtl';
1120
+ var offsetHorizontal = isHorizontal ? _offset : 0;
1121
+ itemStyleCache[index] = style = {
1122
+ position: 'absolute',
1123
+ left: isRtl ? undefined : offsetHorizontal,
1124
+ right: isRtl ? offsetHorizontal : undefined,
1125
+ top: !isHorizontal ? _offset : 0,
1126
+ height: !isHorizontal ? size : '100%',
1127
+ width: isHorizontal ? size : '100%'
1128
+ };
1118
1129
  }
1119
1130
 
1120
1131
  return style;