ab-ui-library 1.57.0 → 1.57.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.
@@ -9,7 +9,7 @@ import { useHideOnResize } from '../../../hooks/useHideOnResize.js';
9
9
  import { noop } from '../../../utils/helpers.js';
10
10
  import { useOnOutsideClick } from '../../../hooks/useOnOutsideClick.js';
11
11
  import '../../../hooks/useScreenSize.js';
12
- import { useGetHasBottomSpace, useGetHasTopSpace } from '../../../hooks/useGetHasBottomSpace.js';
12
+ import { useGetHasBottomSpace } from '../../../hooks/useGetHasBottomSpace.js';
13
13
  import 'react-hook-form';
14
14
  import { useRecalculateDropdownPosition } from '../../../hooks/useRecalculateDropdownPosition.js';
15
15
  import { Input } from '../../Input/Input.js';
@@ -285,10 +285,6 @@ var Select = function Select(props) {
285
285
  input: inputRef.current
286
286
  }),
287
287
  hasBottomSpace = _useGetHasBottomSpace.hasBottomSpace;
288
- var hasTopSpace = useGetHasTopSpace({
289
- element: dropdownRef,
290
- input: inputRef.current
291
- });
292
288
  useChangePositionsOnScroll({
293
289
  parentElement: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current,
294
290
  childElement: dropdownRef,
@@ -354,14 +350,14 @@ var Select = function Select(props) {
354
350
  style: _objectSpread({
355
351
  left: left,
356
352
  width: width
357
- }, hasBottomSpace || !hasTopSpace ? {
358
- top: bottom
353
+ }, hasBottomSpace ? {
354
+ top: bottom,
355
+ maxHeight: top - DROPDOWN_AND_INPUT_GAP
359
356
  } : {
360
- bottom: window.innerHeight - top + DROPDOWN_AND_INPUT_GAP
357
+ bottom: window.innerHeight - top + DROPDOWN_AND_INPUT_GAP,
358
+ maxHeight: window.innerHeight - bottom - DROPDOWN_AND_INPUT_GAP
361
359
  }),
362
- ref: function ref(_ref2) {
363
- setDropdownRef(_ref2);
364
- }
360
+ ref: setDropdownRef
365
361
  }, isLoading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", {
366
362
  "data-id": "".concat(dataId, "-options-content"),
367
363
  ref: scrollRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-ui-library",
3
- "version": "1.57.0",
3
+ "version": "1.57.1",
4
4
  "description": "UI library for AM",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",