@autobest-ui/components 2.0.5-y.0 → 2.0.5-y.2

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.
@@ -65,7 +65,7 @@ export interface SelectProps extends Pick<TriggerProps, 'windowResizeHidden' | '
65
65
  /**
66
66
  * 过滤到结果时才触发,此时并不会触发onChange, 当点击选项或者隐藏列表后才会触发onChange
67
67
  */
68
- onFilterChange: (item: SelectOptionItem, name?: string) => void;
68
+ onFilterChange?: (item: SelectOptionItem, name?: string) => void;
69
69
  /**
70
70
  * 是否最大全宽
71
71
  */
@@ -110,6 +110,7 @@ declare class Select extends React.Component<SelectProps, SelectStates> {
110
110
  disabled: boolean;
111
111
  hiddenIcon: boolean;
112
112
  isMinRootWidth: boolean;
113
+ isFilterOption: boolean;
113
114
  isMaxRootWidth: boolean;
114
115
  };
115
116
  constructor(props: any);
@@ -123,12 +123,18 @@ function (_super) {
123
123
 
124
124
  var element = _this.popupContentRef.current;
125
125
 
126
- if (element) {
127
- var activeElement = element.querySelector(".".concat(_this.prefixCls, "-active"));
128
- activeElement.scrollIntoView({
129
- block: 'nearest',
130
- inline: 'start'
131
- });
126
+ if (element && element.parentNode) {
127
+ var elementParentNode = element.parentNode;
128
+
129
+ if (elementParentNode) {
130
+ var activeElement = elementParentNode.querySelector(".".concat(_this.prefixCls, "-active"));
131
+
132
+ if (activeElement) {
133
+ // scrollIntoView有问题,设置block为start会带动全局的滚动条
134
+ elementParentNode.scrollTop = activeElement.offsetTop;
135
+ elementParentNode.scrollLeft = activeElement.offsetLeft;
136
+ }
137
+ }
132
138
  }
133
139
  });
134
140
  }
@@ -402,6 +408,7 @@ function (_super) {
402
408
  disabled: false,
403
409
  hiddenIcon: false,
404
410
  isMinRootWidth: false,
411
+ isFilterOption: true,
405
412
  isMaxRootWidth: false
406
413
  };
407
414
  return Select;
@@ -65,7 +65,7 @@ export interface SelectProps extends Pick<TriggerProps, 'windowResizeHidden' | '
65
65
  /**
66
66
  * 过滤到结果时才触发,此时并不会触发onChange, 当点击选项或者隐藏列表后才会触发onChange
67
67
  */
68
- onFilterChange: (item: SelectOptionItem, name?: string) => void;
68
+ onFilterChange?: (item: SelectOptionItem, name?: string) => void;
69
69
  /**
70
70
  * 是否最大全宽
71
71
  */
@@ -110,6 +110,7 @@ declare class Select extends React.Component<SelectProps, SelectStates> {
110
110
  disabled: boolean;
111
111
  hiddenIcon: boolean;
112
112
  isMinRootWidth: boolean;
113
+ isFilterOption: boolean;
113
114
  isMaxRootWidth: boolean;
114
115
  };
115
116
  constructor(props: any);
@@ -135,12 +135,18 @@ function (_super) {
135
135
 
136
136
  var element = _this.popupContentRef.current;
137
137
 
138
- if (element) {
139
- var activeElement = element.querySelector(".".concat(_this.prefixCls, "-active"));
140
- activeElement.scrollIntoView({
141
- block: 'nearest',
142
- inline: 'start'
143
- });
138
+ if (element && element.parentNode) {
139
+ var elementParentNode = element.parentNode;
140
+
141
+ if (elementParentNode) {
142
+ var activeElement = elementParentNode.querySelector(".".concat(_this.prefixCls, "-active"));
143
+
144
+ if (activeElement) {
145
+ // scrollIntoView有问题,设置block为start会带动全局的滚动条
146
+ elementParentNode.scrollTop = activeElement.offsetTop;
147
+ elementParentNode.scrollLeft = activeElement.offsetLeft;
148
+ }
149
+ }
144
150
  }
145
151
  });
146
152
  }
@@ -416,6 +422,7 @@ function (_super) {
416
422
  disabled: false,
417
423
  hiddenIcon: false,
418
424
  isMinRootWidth: false,
425
+ isFilterOption: true,
419
426
  isMaxRootWidth: false
420
427
  };
421
428
  return Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/components",
3
- "version": "2.0.5-y.0",
3
+ "version": "2.0.5-y.2",
4
4
  "private": false,
5
5
  "description": "components common ui for React",
6
6
  "main": "lib/index.js",
@@ -46,5 +46,5 @@
46
46
  "react": ">=16.8.6",
47
47
  "react-transition-group": ">=4.2.2"
48
48
  },
49
- "gitHead": "c8153bfb2dd22ba6d3925d08d86529ef78b7ec53"
49
+ "gitHead": "922987f547f608a090e509ccec8cbecc58bb8935"
50
50
  }