@jetbrains/ring-ui 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.
|
@@ -14,7 +14,9 @@ const prevent = (key) => {
|
|
|
14
14
|
getComputedStyle(document.documentElement).overflowY === 'scroll';
|
|
15
15
|
document.documentElement.classList.add(styles.documentWithoutScroll);
|
|
16
16
|
const scrollWidth = scrollbarWidth();
|
|
17
|
-
|
|
17
|
+
const { scrollbarGutter } = getComputedStyle(document.documentElement);
|
|
18
|
+
const documentHasScrollbarGutter = scrollbarGutter === 'stable' || scrollbarGutter === 'both-edges';
|
|
19
|
+
if (documentHasScroll && scrollWidth != null && scrollWidth > 0 && !documentHasScrollbarGutter) {
|
|
18
20
|
previousDocumentWidth = document.documentElement.style.width;
|
|
19
21
|
document.documentElement.style.width = `calc(100% - ${scrollWidth}px)`;
|
|
20
22
|
}
|
package/components/list/list.js
CHANGED
|
@@ -162,9 +162,14 @@ export default class List extends Component {
|
|
|
162
162
|
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
163
163
|
this.virtualizedList.recomputeRowHeights();
|
|
164
164
|
}
|
|
165
|
+
const { activeIndex } = this.state;
|
|
166
|
+
const isActiveItemRetainedPosition = activeIndex
|
|
167
|
+
? prevProps.data[activeIndex]?.key === this.props.data[activeIndex]?.key
|
|
168
|
+
: false;
|
|
165
169
|
if (this.props.activeIndex == null &&
|
|
166
170
|
getDataHash(this.props.data) !== getDataHash(prevProps.data) &&
|
|
167
|
-
shouldActivateFirstItem(this.props)
|
|
171
|
+
shouldActivateFirstItem(this.props) &&
|
|
172
|
+
!isActiveItemRetainedPosition) {
|
|
168
173
|
this.activateFirst();
|
|
169
174
|
}
|
|
170
175
|
this.checkOverflow();
|