@jetbrains/ring-ui-built 6.0.73 → 6.0.74
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/components/list/list.js +4 -1
- package/package.json +1 -1
package/components/list/list.js
CHANGED
@@ -493,10 +493,13 @@ var List = /*#__PURE__*/function (_Component) {
|
|
493
493
|
}, {
|
494
494
|
key: "componentDidUpdate",
|
495
495
|
value: function componentDidUpdate(prevProps) {
|
496
|
+
var _prevProps$data$activ, _this$props$data$acti;
|
496
497
|
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
497
498
|
this.virtualizedList.recomputeRowHeights();
|
498
499
|
}
|
499
|
-
|
500
|
+
var activeIndex = this.state.activeIndex;
|
501
|
+
var isActiveItemRetainedPosition = activeIndex ? ((_prevProps$data$activ = prevProps.data[activeIndex]) === null || _prevProps$data$activ === void 0 ? void 0 : _prevProps$data$activ.key) === ((_this$props$data$acti = this.props.data[activeIndex]) === null || _this$props$data$acti === void 0 ? void 0 : _this$props$data$acti.key) : false;
|
502
|
+
if (this.props.activeIndex == null && getDataHash(this.props.data) !== getDataHash(prevProps.data) && shouldActivateFirstItem(this.props) && !isActiveItemRetainedPosition) {
|
500
503
|
this.activateFirst();
|
501
504
|
}
|
502
505
|
this.checkOverflow();
|