shineout 1.12.20 → 1.12.21

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.
@@ -377,7 +377,9 @@ function _default(List) {
377
377
  getRef: this.handleRef
378
378
  }, props, {
379
379
  focus: focus,
380
- style: mergeStyle
380
+ autoAdapt: autoAdapt,
381
+ style: mergeStyle,
382
+ resetPosition: this.resetPosition.bind(this)
381
383
  })), this.element);
382
384
  };
383
385
 
@@ -164,7 +164,9 @@ function (_Component) {
164
164
  var _this$props2 = this.props,
165
165
  data = _this$props2.data,
166
166
  itemsInView = _this$props2.itemsInView,
167
- lineHeight = _this$props2.lineHeight;
167
+ lineHeight = _this$props2.lineHeight,
168
+ autoAdapt = _this$props2.autoAdapt,
169
+ resetPosition = _this$props2.resetPosition;
168
170
  var fullHeight = itemsInView * lineHeight;
169
171
  var contentHeight = data.length * lineHeight - h;
170
172
  var scrollTop = h > fullHeight ? 0 : y;
@@ -189,6 +191,10 @@ function (_Component) {
189
191
  scrollTop: scrollTop,
190
192
  currentIndex: index
191
193
  });
194
+
195
+ if (autoAdapt && resetPosition) {
196
+ resetPosition(autoAdapt);
197
+ }
192
198
  };
193
199
 
194
200
  _proto.handleHover = function handleHover(index, force) {
@@ -326,7 +332,9 @@ OptionList.propTypes = {
326
332
  filterText: _propTypes.default.string,
327
333
  hideCreateOption: _propTypes.default.bool,
328
334
  emptyText: _propTypes.default.node,
329
- renderOptionList: _propTypes.default.func
335
+ renderOptionList: _propTypes.default.func,
336
+ autoAdapt: _propTypes.default.bool,
337
+ resetPosition: _propTypes.default.func
330
338
  };
331
339
  var _default = OptionList;
332
340
  exports.default = _default;
@@ -634,6 +634,7 @@ function (_PureComponent) {
634
634
  };
635
635
  return _react.default.createElement(List, (0, _extends2.default)({}, props, {
636
636
  style: style,
637
+ autoAdapt: autoAdapt,
637
638
  rootClass: (0, _styles.selectClass)(position, (0, _config.isRTL)() && 'rtl'),
638
639
  autoClass: (0, _styles.selectClass)(autoAdapt && 'auto-adapt'),
639
640
  bindOptionFunc: this.bindOptionFunc,
package/css/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as utils from './utils'
3
3
 
4
4
  declare const __default: {
5
5
  utils: typeof utils,
6
- version: '1.12.20'
6
+ version: '1.12.21'
7
7
  }
8
8
 
9
9
  export default __default
package/css/index.js CHANGED
@@ -224,6 +224,6 @@ exports.Upload = _Upload.default;
224
224
  // Created by scripts/src-index.js.
225
225
  var _default = {
226
226
  utils: utils,
227
- version: '1.12.20'
227
+ version: '1.12.21'
228
228
  };
229
229
  exports.default = _default;