@xqmsg/ui-core 0.15.0 → 0.15.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.
@@ -582,7 +582,7 @@ var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange"
582
582
  */
583
583
 
584
584
  var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
585
- var _options$find$label, _options$find;
585
+ var _options$find$label, _options$find, _dropdownRef$current;
586
586
 
587
587
  var isRequired = _ref2.isRequired,
588
588
  options = _ref2.options,
@@ -609,17 +609,18 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
609
609
  position = _useState3[0],
610
610
  setPosition = _useState3[1];
611
611
 
612
+ var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
612
613
  React.useEffect(function () {
613
- var _dropdownRef$current;
614
+ var _dropdownRef$current2;
614
615
 
615
- var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
616
+ var boundingClientRect = (_dropdownRef$current2 = dropdownRef.current) == null ? void 0 : _dropdownRef$current2.getBoundingClientRect();
616
617
 
617
- if (document.body.clientHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
618
+ if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
618
619
  setPosition('top');
619
620
  } else {
620
621
  setPosition('bottom');
621
622
  }
622
- }, [dropdownRef]);
623
+ }, [boundingClientRect]);
623
624
  useDidMountEffect(function () {
624
625
  var _options$find$label2, _options$find2;
625
626
 
@@ -766,6 +767,8 @@ var Token = function Token(_ref) {
766
767
  */
767
768
 
768
769
  var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
770
+ var _dropdownRef$current;
771
+
769
772
  var options = _ref2.options,
770
773
  setValue = _ref2.setValue,
771
774
  control = _ref2.control,
@@ -801,17 +804,14 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
801
804
  position = _useState5[0],
802
805
  setPosition = _useState5[1];
803
806
 
807
+ var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
804
808
  React.useEffect(function () {
805
- var _dropdownRef$current;
806
-
807
- var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
808
-
809
- if (document.body.clientHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
809
+ if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
810
810
  setPosition('top');
811
811
  } else {
812
812
  setPosition('bottom');
813
813
  }
814
- }, [dropdownRef]);
814
+ }, [boundingClientRect]);
815
815
  react.useOutsideClick({
816
816
  ref: dropdownRef,
817
817
  handler: function handler() {