@itwin/itwinui-react 2.4.1 → 2.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - cbcd97a4: Fixed an issue in ComboBox where the height of empty state content was not getting updated when using `enableVirtualization`.
8
+
3
9
  ## 2.4.1
4
10
 
5
11
  ### Patch Changes
@@ -1,7 +1,31 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
28
+ var _a;
5
29
  Object.defineProperty(exports, "__esModule", { value: true });
6
30
  exports.useVirtualization = exports.VirtualScroll = void 0;
7
31
  /*---------------------------------------------------------------------------------------------
@@ -9,7 +33,9 @@ exports.useVirtualization = exports.VirtualScroll = void 0;
9
33
  * See LICENSE.md in the project root for license terms and full copyright notice.
10
34
  *--------------------------------------------------------------------------------------------*/
11
35
  const react_1 = __importDefault(require("react"));
36
+ const ReactDOM = __importStar(require("react-dom"));
12
37
  const hooks_1 = require("../hooks");
38
+ const unstable_batchedUpdates = (_a = ReactDOM.unstable_batchedUpdates) !== null && _a !== void 0 ? _a : ((cb) => void cb());
13
39
  const getScrollableParent = (element, ownerDocument = document) => {
14
40
  if (!element || element === ownerDocument.body) {
15
41
  return ownerDocument.body;
@@ -145,8 +171,10 @@ const useVirtualization = (props) => {
145
171
  if (height > 0) {
146
172
  setIsMounted(true);
147
173
  }
148
- setScrollContainerHeight(height);
149
- updateChildHeight();
174
+ unstable_batchedUpdates(() => {
175
+ setScrollContainerHeight(height);
176
+ updateChildHeight();
177
+ });
150
178
  }, [updateChildHeight]);
151
179
  const [resizeRef, resizeObserver] = (0, hooks_1.useResizeObserver)(onResize);
152
180
  // Find scrollable parent
@@ -1,9 +1,12 @@
1
+ var _a;
1
2
  /*---------------------------------------------------------------------------------------------
2
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
5
  *--------------------------------------------------------------------------------------------*/
5
6
  import React from 'react';
7
+ import * as ReactDOM from 'react-dom';
6
8
  import { mergeRefs, useResizeObserver, useIsomorphicLayoutEffect, } from '../hooks';
9
+ const unstable_batchedUpdates = (_a = ReactDOM.unstable_batchedUpdates) !== null && _a !== void 0 ? _a : ((cb) => void cb());
7
10
  const getScrollableParent = (element, ownerDocument = document) => {
8
11
  if (!element || element === ownerDocument.body) {
9
12
  return ownerDocument.body;
@@ -139,8 +142,10 @@ export const useVirtualization = (props) => {
139
142
  if (height > 0) {
140
143
  setIsMounted(true);
141
144
  }
142
- setScrollContainerHeight(height);
143
- updateChildHeight();
145
+ unstable_batchedUpdates(() => {
146
+ setScrollContainerHeight(height);
147
+ updateChildHeight();
148
+ });
144
149
  }, [updateChildHeight]);
145
150
  const [resizeRef, resizeObserver] = useResizeObserver(onResize);
146
151
  // Find scrollable parent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "cjs/index.js",