carbon-react 138.1.1 → 138.2.1
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/esm/components/action-popover/action-popover.style.js +0 -4
- package/esm/components/select/select-list/select-list.component.js +8 -1
- package/lib/components/action-popover/action-popover.style.js +0 -4
- package/lib/components/select/select-list/select-list.component.js +8 -1
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ import { margin } from "styled-system";
|
|
|
3
3
|
import Icon from "../icon";
|
|
4
4
|
import StyledIcon from "../icon/icon.style";
|
|
5
5
|
import StyledButton from "../button/button.style";
|
|
6
|
-
import { isSafari } from "../../__internal__/utils/helpers/browser-type-check";
|
|
7
6
|
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
8
7
|
import baseTheme from "../../style/themes/base";
|
|
9
8
|
const oldFocusStyling = `
|
|
@@ -224,9 +223,6 @@ const SubMenuItemIcon = styled(ButtonIcon)`
|
|
|
224
223
|
|
|
225
224
|
${type === "chevron_right_thick" && css`
|
|
226
225
|
right: -5px;
|
|
227
|
-
${isSafari(navigator) && css`
|
|
228
|
-
top: var(--sizing100);
|
|
229
|
-
`}
|
|
230
226
|
`}
|
|
231
227
|
`}
|
|
232
228
|
`;
|
|
@@ -118,7 +118,14 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const totalSize = virtualizer.getTotalSize();
|
|
122
|
+
// virtualizer.getTotalSize() returns the total size in pixels for the virtualized items. If nothing is loaded,
|
|
123
|
+
// then the list height is set to 0 (line 21 of src/components/select/select-list/select-list.style.ts) as
|
|
124
|
+
// the method always returns a number and never undefined, it seems.
|
|
125
|
+
// https://github.com/TanStack/virtual/commit/e43e03e500588b2da36f184ecaba2b8e5a506596 suggests that items are
|
|
126
|
+
// never returned regardless if the container height it 0, so the below line ensures that a container of at
|
|
127
|
+
// least 1px is always available to render into.
|
|
128
|
+
const listHeight = totalSize === 0 ? 1 : totalSize;
|
|
122
129
|
useEffect(() => {
|
|
123
130
|
if (isOpen) {
|
|
124
131
|
blockScroll();
|
|
@@ -9,7 +9,6 @@ var _styledSystem = require("styled-system");
|
|
|
9
9
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
10
10
|
var _icon2 = _interopRequireDefault(require("../icon/icon.style"));
|
|
11
11
|
var _button = _interopRequireDefault(require("../button/button.style"));
|
|
12
|
-
var _browserTypeCheck = require("../../__internal__/utils/helpers/browser-type-check");
|
|
13
12
|
var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
|
|
14
13
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -233,9 +232,6 @@ const SubMenuItemIcon = exports.SubMenuItemIcon = (0, _styledComponents.default)
|
|
|
233
232
|
|
|
234
233
|
${type === "chevron_right_thick" && (0, _styledComponents.css)`
|
|
235
234
|
right: -5px;
|
|
236
|
-
${(0, _browserTypeCheck.isSafari)(navigator) && (0, _styledComponents.css)`
|
|
237
|
-
top: var(--sizing100);
|
|
238
|
-
`}
|
|
239
235
|
`}
|
|
240
236
|
`}
|
|
241
237
|
`;
|
|
@@ -127,7 +127,14 @@ const SelectList = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const totalSize = virtualizer.getTotalSize();
|
|
131
|
+
// virtualizer.getTotalSize() returns the total size in pixels for the virtualized items. If nothing is loaded,
|
|
132
|
+
// then the list height is set to 0 (line 21 of src/components/select/select-list/select-list.style.ts) as
|
|
133
|
+
// the method always returns a number and never undefined, it seems.
|
|
134
|
+
// https://github.com/TanStack/virtual/commit/e43e03e500588b2da36f184ecaba2b8e5a506596 suggests that items are
|
|
135
|
+
// never returned regardless if the container height it 0, so the below line ensures that a container of at
|
|
136
|
+
// least 1px is always available to render into.
|
|
137
|
+
const listHeight = totalSize === 0 ? 1 : totalSize;
|
|
131
138
|
(0, _react.useEffect)(() => {
|
|
132
139
|
if (isOpen) {
|
|
133
140
|
blockScroll();
|