@jetbrains/ring-ui-built 6.0.72 → 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.
@@ -19,7 +19,10 @@ var _prevent = function prevent(key) {
19
19
  var documentHasScroll = document.documentElement.scrollHeight > window.innerHeight || getComputedStyle(document.documentElement).overflowY === 'scroll';
20
20
  document.documentElement.classList.add(modules_5e9b8c03.documentWithoutScroll);
21
21
  var scrollWidth = scrollbarWidth();
22
- if (documentHasScroll && scrollWidth != null && scrollWidth > 0) {
22
+ var _getComputedStyle = getComputedStyle(document.documentElement),
23
+ scrollbarGutter = _getComputedStyle.scrollbarGutter;
24
+ var documentHasScrollbarGutter = scrollbarGutter === 'stable' || scrollbarGutter === 'both-edges';
25
+ if (documentHasScroll && scrollWidth != null && scrollWidth > 0 && !documentHasScrollbarGutter) {
23
26
  previousDocumentWidth = document.documentElement.style.width;
24
27
  document.documentElement.style.width = "calc(100% - ".concat(scrollWidth, "px)");
25
28
  }
@@ -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
- if (this.props.activeIndex == null && getDataHash(this.props.data) !== getDataHash(prevProps.data) && shouldActivateFirstItem(this.props)) {
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui-built",
3
- "version": "6.0.72",
3
+ "version": "6.0.74",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",