funda-ui 4.5.635 → 4.5.657

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/Select/index.js CHANGED
@@ -4155,6 +4155,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4155
4155
  return _fetchData.apply(this, arguments);
4156
4156
  }
4157
4157
  function adjustMultiControlContainerHeight() {
4158
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4158
4159
  setTimeout(function () {
4159
4160
  // Sometimes you may get 0, you need to judge
4160
4161
  if (MULTI_SEL_VALID && rootMultiRef.current.clientHeight > 0) {
@@ -4164,7 +4165,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4164
4165
  // popwin position update
4165
4166
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
4166
4167
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
4167
- popwinPosInit();
4168
+ popwinPosInit(scrollbarInit);
4168
4169
  }
4169
4170
  }, 0);
4170
4171
  }
@@ -4180,6 +4181,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4180
4181
  }
4181
4182
  }
4182
4183
  function popwinPosInit() {
4184
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4183
4185
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4184
4186
  var contentHeightOffset = 80;
4185
4187
  var contentMaxHeight = 0;
@@ -4319,7 +4321,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4319
4321
  // STEP 7:
4320
4322
  //-----------
4321
4323
  // Scrollbar position synchronization
4322
- syncListContentScrollBody();
4324
+ if (scrollbarInit) syncListContentScrollBody();
4323
4325
  }
4324
4326
  function popwinPosHide() {
4325
4327
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
@@ -4655,7 +4657,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4655
4657
  }
4656
4658
 
4657
4659
  // Appropriate multi-item container height
4658
- adjustMultiControlContainerHeight();
4660
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4661
+ adjustMultiControlContainerHeight(false);
4659
4662
 
4660
4663
  // active current option
4661
4664
  if (noCallback) {
@@ -4761,7 +4764,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4761
4764
  }
4762
4765
 
4763
4766
  // Appropriate multi-item container height
4764
- adjustMultiControlContainerHeight();
4767
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4768
+ adjustMultiControlContainerHeight(false);
4765
4769
 
4766
4770
  // active current option
4767
4771
  if (noCallback) {
@@ -4155,6 +4155,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4155
4155
  return _fetchData.apply(this, arguments);
4156
4156
  }
4157
4157
  function adjustMultiControlContainerHeight() {
4158
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4158
4159
  setTimeout(function () {
4159
4160
  // Sometimes you may get 0, you need to judge
4160
4161
  if (MULTI_SEL_VALID && rootMultiRef.current.clientHeight > 0) {
@@ -4164,7 +4165,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4164
4165
  // popwin position update
4165
4166
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
4166
4167
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
4167
- popwinPosInit();
4168
+ popwinPosInit(scrollbarInit);
4168
4169
  }
4169
4170
  }, 0);
4170
4171
  }
@@ -4180,6 +4181,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4180
4181
  }
4181
4182
  }
4182
4183
  function popwinPosInit() {
4184
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4183
4185
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4184
4186
  var contentHeightOffset = 80;
4185
4187
  var contentMaxHeight = 0;
@@ -4319,7 +4321,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4319
4321
  // STEP 7:
4320
4322
  //-----------
4321
4323
  // Scrollbar position synchronization
4322
- syncListContentScrollBody();
4324
+ if (scrollbarInit) syncListContentScrollBody();
4323
4325
  }
4324
4326
  function popwinPosHide() {
4325
4327
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
@@ -4655,7 +4657,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4655
4657
  }
4656
4658
 
4657
4659
  // Appropriate multi-item container height
4658
- adjustMultiControlContainerHeight();
4660
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4661
+ adjustMultiControlContainerHeight(false);
4659
4662
 
4660
4663
  // active current option
4661
4664
  if (noCallback) {
@@ -4761,7 +4764,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4761
4764
  }
4762
4765
 
4763
4766
  // Appropriate multi-item container height
4764
- adjustMultiControlContainerHeight();
4767
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4768
+ adjustMultiControlContainerHeight(false);
4765
4769
 
4766
4770
  // active current option
4767
4771
  if (noCallback) {
@@ -49,6 +49,8 @@ import {
49
49
  import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
50
50
 
51
51
 
52
+
53
+
52
54
  export type SelectOptionChangeFnType = (arg1: any, arg2: any, arg3: any) => void;
53
55
 
54
56
  export interface MultiSelectDataConfig {
@@ -825,7 +827,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
825
827
  }
826
828
 
827
829
 
828
- function adjustMultiControlContainerHeight() {
830
+ function adjustMultiControlContainerHeight(scrollbarInit: boolean = true) {
829
831
  setTimeout(() => {
830
832
 
831
833
 
@@ -837,7 +839,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
837
839
  // popwin position update
838
840
  const _modalRef: any = document.querySelector(`#custom-select__options-wrapper-${idRes}`);
839
841
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
840
- popwinPosInit();
842
+ popwinPosInit(scrollbarInit);
841
843
  }
842
844
 
843
845
 
@@ -862,7 +864,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
862
864
  }
863
865
 
864
866
 
865
- function popwinPosInit() {
867
+ function popwinPosInit(scrollbarInit: boolean = true) {
866
868
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
867
869
 
868
870
  const contentHeightOffset = 80;
@@ -1036,7 +1038,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1036
1038
  // STEP 7:
1037
1039
  //-----------
1038
1040
  // Scrollbar position synchronization
1039
- syncListContentScrollBody();
1041
+ if (scrollbarInit) syncListContentScrollBody();
1042
+
1040
1043
 
1041
1044
 
1042
1045
  }
@@ -1435,7 +1438,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1435
1438
  }
1436
1439
 
1437
1440
  // Appropriate multi-item container height
1438
- adjustMultiControlContainerHeight();
1441
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
1442
+ adjustMultiControlContainerHeight(false);
1439
1443
 
1440
1444
 
1441
1445
  // active current option
@@ -1586,7 +1590,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1586
1590
 
1587
1591
 
1588
1592
  // Appropriate multi-item container height
1589
- adjustMultiControlContainerHeight();
1593
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
1594
+ adjustMultiControlContainerHeight(false);
1590
1595
 
1591
1596
  // active current option
1592
1597
  if (noCallback) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "4.5.635",
5
+ "version": "4.5.657",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",