funda-ui 4.7.533 → 4.7.555

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.
@@ -3026,7 +3026,6 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3026
3026
  if (isBlurringRef.current && !MANUAL_REQ) return;
3027
3027
 
3028
3028
  //
3029
- var contentHeightOffset = 80;
3030
3029
  var contentMaxHeight = 0;
3031
3030
 
3032
3031
  // update modal position
@@ -3067,6 +3066,11 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3067
3066
  var _contentActualHeight = listContentRef.current.querySelector('.livesearch__options-contentlist-inner').clientHeight;
3068
3067
  if (targetPos === 'top') {
3069
3068
  contentMaxHeight = _triggerBox.top;
3069
+
3070
+ // Calculate the final height with minimum height protection
3071
+ var contentHeightOffset = 0;
3072
+ var finalHeight = Math.max(contentMaxHeight - contentHeightOffset, 150); // Ensure minimum height of 150px
3073
+
3070
3074
  if (_contentBox.height > _contentActualHeight) {
3071
3075
  if (_contentActualHeight > 0) listContentRef.current.style.height = _contentActualHeight + 'px';
3072
3076
  } else {
@@ -3074,11 +3078,16 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3074
3078
 
3075
3079
  // recalculate the height
3076
3080
  _contentBox = listContentRef.current.getBoundingClientRect();
3077
- if (_contentBox.height > contentMaxHeight) listContentRef.current.style.height = contentMaxHeight - contentHeightOffset + 'px';
3081
+ if (_contentBox.height > contentMaxHeight) listContentRef.current.style.height = finalHeight + 'px';
3078
3082
  }
3079
3083
  }
3080
3084
  if (targetPos === 'bottom') {
3081
3085
  contentMaxHeight = window.innerHeight - _triggerBox.bottom;
3086
+
3087
+ // Calculate the final height with minimum height protection
3088
+ var _contentHeightOffset = 10;
3089
+ var _finalHeight = Math.max(contentMaxHeight - _contentHeightOffset, 150); // Ensure minimum height of 150px
3090
+
3082
3091
  if (_contentBox.height > _contentActualHeight) {
3083
3092
  if (_contentActualHeight > 0) listContentRef.current.style.height = _contentActualHeight + 'px';
3084
3093
  } else {
@@ -3086,7 +3095,7 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3086
3095
 
3087
3096
  // recalculate the height
3088
3097
  _contentBox = listContentRef.current.getBoundingClientRect();
3089
- if (_contentBox.height > contentMaxHeight) listContentRef.current.style.height = contentMaxHeight - 10 + 'px';
3098
+ if (_contentBox.height > contentMaxHeight) listContentRef.current.style.height = _finalHeight + 'px';
3090
3099
  }
3091
3100
  }
3092
3101
 
@@ -3095,17 +3104,16 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3095
3104
  // Adjust position
3096
3105
  if (targetPos === 'top') {
3097
3106
  _modalRef.style.left = x + 'px';
3098
- //_modalRef.style.top = y - POS_OFFSET - (listContentRef.current.clientHeight) - 2 + 'px';
3099
- _modalRef.style.top = 'auto';
3100
- _modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
3101
- _modalRef.style.setProperty('position', 'fixed', 'important');
3107
+ _modalRef.style.bottom = 'auto';
3108
+ // Position the popup above the trigger without overlapping
3109
+ var topPosition = y - POS_OFFSET - listContentRef.current.clientHeight - 2;
3110
+ _modalRef.style.top = topPosition + 'px';
3102
3111
  _modalRef.classList.add('pos-top');
3103
3112
  }
3104
3113
  if (targetPos === 'bottom') {
3105
3114
  _modalRef.style.left = x + 'px';
3106
3115
  _modalRef.style.bottom = 'auto';
3107
3116
  _modalRef.style.top = y + height + POS_OFFSET + 'px';
3108
- _modalRef.style.setProperty('position', 'absolute', 'important');
3109
3117
  _modalRef.classList.remove('pos-top');
3110
3118
  }
3111
3119
 
package/Select/index.js CHANGED
@@ -4289,7 +4289,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4289
4289
  if (isBlurringRef.current) return;
4290
4290
 
4291
4291
  //
4292
- var contentHeightOffset = 80;
4293
4292
  var contentMaxHeight = 0;
4294
4293
 
4295
4294
  // update modal position
@@ -4370,9 +4369,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4370
4369
 
4371
4370
  // height restrictions
4372
4371
  contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4372
+
4373
+ // Calculate the final height with minimum height protection
4374
+ var contentHeightOffset = 0;
4375
+ var finalHeight = Math.max(contentMaxHeight - contentHeightOffset, 150); // Ensure minimum height of 150px
4376
+
4373
4377
  if (_contentBox.height > contentMaxHeight) {
4374
- listContentRef.current.style.height = contentMaxHeight - contentHeightOffset + 'px';
4375
- if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - contentHeightOffset;
4378
+ listContentRef.current.style.height = finalHeight + 'px';
4379
+ if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = finalHeight;
4376
4380
 
4377
4381
  // has scrollbar
4378
4382
  listContentRef.current.dataset.hasScrollbar = 'true';
@@ -4393,9 +4397,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4393
4397
 
4394
4398
  // height restrictions
4395
4399
  contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4400
+
4401
+ // Calculate the final height with minimum height protection
4402
+ var _contentHeightOffset = 10;
4403
+ var _finalHeight = Math.max(contentMaxHeight - _contentHeightOffset, 150); // Ensure minimum height of 150px
4404
+
4396
4405
  if (_contentBox.height > contentMaxHeight) {
4397
- listContentRef.current.style.height = contentMaxHeight - 10 + 'px';
4398
- if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - 10;
4406
+ listContentRef.current.style.height = _finalHeight + 'px';
4407
+ if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = _finalHeight;
4399
4408
 
4400
4409
  // has scrollbar
4401
4410
  listContentRef.current.dataset.hasScrollbar = 'true';