@douyinfe/semi-foundation 2.67.2-alpha.1 → 2.67.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.
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
436
436
  &-icon {
437
437
  display: inline-flex;
438
438
  flex-shrink: 0;
439
- width: $width-cascader-icon;
439
+ width:$width-cascader-option-icon;
440
440
  color: $color-cascader_option-icon-default;
441
441
 
442
442
  &-active,
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
450
450
  }
451
451
 
452
452
  &-spin-icon {
453
- width: $width-cascader-icon;
454
- height: $width-cascader-icon;
453
+ width: $width-cascader-option-icon;
454
+ height: $width-cascader-option-icon;
455
455
  line-height: 0;
456
456
 
457
457
  & svg {
458
- width: $width-cascader-icon;
459
- height: $width-cascader-icon;
458
+ width: $width-cascader-option-icon;
459
+ height: $width-cascader-option-icon;
460
460
  }
461
461
  }
462
462
 
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
92
92
  $width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
93
93
  $width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
94
94
  $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
95
- $width-cascader-icon: 32px; // 级联选择图标尺寸
95
+ $width-cascader-icon: 32px; // 级联选择触发器图标尺寸
96
+ $width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
96
97
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
97
98
  $height-cascader_option_list: 180px; // 级联选择菜单高度
98
99
  $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
@@ -227,7 +227,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
227
227
  */
228
228
  export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
229
229
 
230
- clickConfirmButton: boolean;
231
230
  constructor(adapter: DatePickerAdapter) {
232
231
  super({ ...adapter });
233
232
  }
@@ -389,17 +388,12 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
389
388
  * - date type and not multiple, close panel after select date
390
389
  * - dateRange type, close panel after select rangeStart and rangeEnd
391
390
  * 4. click outside
392
- * @param {Event} e
393
- * @param {String} inputValue
394
- * @param {Date[]} dates
395
391
  */
396
- closePanel(e?: any, inputValue: string = null, dates?: Date[]) {
397
- const { value } = this._adapter.getStates();
398
- const willUpdateDates = isNullOrUndefined(dates) ? value : dates;
392
+ closePanel() {
399
393
  if (!this._isControlledComponent('open')) {
400
394
  this.close();
401
395
  } else {
402
- this.resetInnerSelectedStates(willUpdateDates);
396
+ this.resetInnerSelectedStates();
403
397
  }
404
398
  this._adapter.notifyOpenChange(false);
405
399
  }
@@ -410,7 +404,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
410
404
  }
411
405
 
412
406
  close() {
413
- this._adapter.togglePanel(false, () => this.resetInnerSelectedStates());
407
+ this._adapter.togglePanel(false);
408
+ this.resetInnerSelectedStates();
414
409
  this._adapter.unregisterClickOutSide();
415
410
  }
416
411
 
@@ -434,15 +429,16 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
434
429
  /**
435
430
  * reset cachedSelectedValue, inputValue when close panel
436
431
  */
437
- resetInnerSelectedStates(willUpdateDates?: Date[]) {
438
- const { value } = this._adapter.getStates();
439
- const needResetCachedSelectedValue = isNullOrUndefined(willUpdateDates) || !this.isCachedSelectedValueValid(willUpdateDates) || this._adapter.needConfirm() && !this.clickConfirmButton;
440
- if (needResetCachedSelectedValue) {
441
- this.resetCachedSelectedValue(value);
442
- }
432
+ resetInnerSelectedStates() {
433
+ // 通过 setTimeout 保证需要获取到最新的 state 状态
434
+ setTimeout(() => {
435
+ const { value, cachedSelectedValue } = this._adapter.getStates();
436
+ if (!isEqual(value, cachedSelectedValue)) {
437
+ this.resetCachedSelectedValue(value);
438
+ }
439
+ }, 0);
443
440
  this.resetFocus();
444
441
  this.clearInputValue();
445
- this.clickConfirmButton = false;
446
442
  }
447
443
 
448
444
  resetFocus(e?: any) {
@@ -1016,7 +1012,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
1016
1012
 
1017
1013
  const focusRecordChecked = !needCheckFocusRecord || (needCheckFocusRecord && this._adapter.couldPanelClosed());
1018
1014
  if ((type === 'date' && !this._isMultiple() && closePanel) || (type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked)) {
1019
- this.closePanel(undefined, inputValue, dates);
1015
+ this.closePanel();
1020
1016
  }
1021
1017
  }
1022
1018
 
@@ -1043,7 +1039,6 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
1043
1039
  }
1044
1040
 
1045
1041
  handleConfirm() {
1046
- this.clickConfirmButton = true;
1047
1042
  const { cachedSelectedValue, value } = this._adapter.getStates();
1048
1043
  const isRangeValueComplete = this._isRangeValueComplete(cachedSelectedValue);
1049
1044
  const newValue = isRangeValueComplete ? cachedSelectedValue : value;
@@ -1051,7 +1046,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
1051
1046
  this._adapter.updateValue(newValue);
1052
1047
  }
1053
1048
  // If the input is incomplete, the legal date of the last input is used
1054
- this.closePanel(undefined, undefined, newValue);
1049
+ this.closePanel();
1055
1050
 
1056
1051
  if (isRangeValueComplete) {
1057
1052
  const { notifyValue, notifyDate } = this.disposeCallbackArgs(cachedSelectedValue);
@@ -359,7 +359,7 @@
359
359
  .semi-cascader-option-lists .semi-cascader-option-icon {
360
360
  display: inline-flex;
361
361
  flex-shrink: 0;
362
- width: 32px;
362
+ width: 16px;
363
363
  color: var(--semi-color-text-2);
364
364
  }
365
365
  .semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
@@ -369,13 +369,13 @@
369
369
  margin-left: 8px;
370
370
  }
371
371
  .semi-cascader-option-lists .semi-cascader-option-spin-icon {
372
- width: 32px;
373
- height: 32px;
372
+ width: 16px;
373
+ height: 16px;
374
374
  line-height: 0;
375
375
  }
376
376
  .semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
377
- width: 32px;
378
- height: 32px;
377
+ width: 16px;
378
+ height: 16px;
379
379
  }
380
380
  .semi-cascader-option-lists .semi-cascader-option-label {
381
381
  display: flex;
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
436
436
  &-icon {
437
437
  display: inline-flex;
438
438
  flex-shrink: 0;
439
- width: $width-cascader-icon;
439
+ width:$width-cascader-option-icon;
440
440
  color: $color-cascader_option-icon-default;
441
441
 
442
442
  &-active,
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
450
450
  }
451
451
 
452
452
  &-spin-icon {
453
- width: $width-cascader-icon;
454
- height: $width-cascader-icon;
453
+ width: $width-cascader-option-icon;
454
+ height: $width-cascader-option-icon;
455
455
  line-height: 0;
456
456
 
457
457
  & svg {
458
- width: $width-cascader-icon;
459
- height: $width-cascader-icon;
458
+ width: $width-cascader-option-icon;
459
+ height: $width-cascader-option-icon;
460
460
  }
461
461
  }
462
462
 
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
92
92
  $width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
93
93
  $width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
94
94
  $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
95
- $width-cascader-icon: 32px; // 级联选择图标尺寸
95
+ $width-cascader-icon: 32px; // 级联选择触发器图标尺寸
96
+ $width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
96
97
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
97
98
  $height-cascader_option_list: 180px; // 级联选择菜单高度
98
99
  $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
@@ -190,7 +190,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
190
190
  * task 2. When the input box changes, update the date value = > Notify the change
191
191
  */
192
192
  export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
193
- clickConfirmButton: boolean;
194
193
  constructor(adapter: DatePickerAdapter);
195
194
  init(): void;
196
195
  initFromProps({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps, 'value' | 'timeZone'> & {
@@ -247,11 +246,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
247
246
  * - date type and not multiple, close panel after select date
248
247
  * - dateRange type, close panel after select rangeStart and rangeEnd
249
248
  * 4. click outside
250
- * @param {Event} e
251
- * @param {String} inputValue
252
- * @param {Date[]} dates
253
249
  */
254
- closePanel(e?: any, inputValue?: string, dates?: Date[]): void;
250
+ closePanel(): void;
255
251
  open(): void;
256
252
  close(): void;
257
253
  focus(focusType?: Exclude<RangeType, false>): void;
@@ -259,7 +255,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
259
255
  /**
260
256
  * reset cachedSelectedValue, inputValue when close panel
261
257
  */
262
- resetInnerSelectedStates(willUpdateDates?: Date[]): void;
258
+ resetInnerSelectedStates(): void;
263
259
  resetFocus(e?: any): void;
264
260
  /**
265
261
  * cachedSelectedValue can be `(Date|null)[]` or `null`
@@ -217,21 +217,12 @@ class DatePickerFoundation extends _foundation.default {
217
217
  * - date type and not multiple, close panel after select date
218
218
  * - dateRange type, close panel after select rangeStart and rangeEnd
219
219
  * 4. click outside
220
- * @param {Event} e
221
- * @param {String} inputValue
222
- * @param {Date[]} dates
223
220
  */
224
- closePanel(e) {
225
- let inputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
226
- let dates = arguments.length > 2 ? arguments[2] : undefined;
227
- const {
228
- value
229
- } = this._adapter.getStates();
230
- const willUpdateDates = (0, _isNullOrUndefined.default)(dates) ? value : dates;
221
+ closePanel() {
231
222
  if (!this._isControlledComponent('open')) {
232
223
  this.close();
233
224
  } else {
234
- this.resetInnerSelectedStates(willUpdateDates);
225
+ this.resetInnerSelectedStates();
235
226
  }
236
227
  this._adapter.notifyOpenChange(false);
237
228
  }
@@ -240,7 +231,8 @@ class DatePickerFoundation extends _foundation.default {
240
231
  this._adapter.registerClickOutSide();
241
232
  }
242
233
  close() {
243
- this._adapter.togglePanel(false, () => this.resetInnerSelectedStates());
234
+ this._adapter.togglePanel(false);
235
+ this.resetInnerSelectedStates();
244
236
  this._adapter.unregisterClickOutSide();
245
237
  }
246
238
  focus(focusType) {
@@ -261,17 +253,19 @@ class DatePickerFoundation extends _foundation.default {
261
253
  /**
262
254
  * reset cachedSelectedValue, inputValue when close panel
263
255
  */
264
- resetInnerSelectedStates(willUpdateDates) {
265
- const {
266
- value
267
- } = this._adapter.getStates();
268
- const needResetCachedSelectedValue = (0, _isNullOrUndefined.default)(willUpdateDates) || !this.isCachedSelectedValueValid(willUpdateDates) || this._adapter.needConfirm() && !this.clickConfirmButton;
269
- if (needResetCachedSelectedValue) {
270
- this.resetCachedSelectedValue(value);
271
- }
256
+ resetInnerSelectedStates() {
257
+ // 通过 setTimeout 保证需要获取到最新的 state 状态
258
+ setTimeout(() => {
259
+ const {
260
+ value,
261
+ cachedSelectedValue
262
+ } = this._adapter.getStates();
263
+ if (!(0, _isEqual2.default)(value, cachedSelectedValue)) {
264
+ this.resetCachedSelectedValue(value);
265
+ }
266
+ }, 0);
272
267
  this.resetFocus();
273
268
  this.clearInputValue();
274
- this.clickConfirmButton = false;
275
269
  }
276
270
  resetFocus(e) {
277
271
  this._adapter.setRangeInputFocus(false);
@@ -825,7 +819,7 @@ class DatePickerFoundation extends _foundation.default {
825
819
  }
826
820
  const focusRecordChecked = !needCheckFocusRecord || needCheckFocusRecord && this._adapter.couldPanelClosed();
827
821
  if (type === 'date' && !this._isMultiple() && closePanel || type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked) {
828
- this.closePanel(undefined, inputValue, dates);
822
+ this.closePanel();
829
823
  }
830
824
  }
831
825
  /**
@@ -852,7 +846,6 @@ class DatePickerFoundation extends _foundation.default {
852
846
  }
853
847
  }
854
848
  handleConfirm() {
855
- this.clickConfirmButton = true;
856
849
  const {
857
850
  cachedSelectedValue,
858
851
  value
@@ -863,7 +856,7 @@ class DatePickerFoundation extends _foundation.default {
863
856
  this._adapter.updateValue(newValue);
864
857
  }
865
858
  // If the input is incomplete, the legal date of the last input is used
866
- this.closePanel(undefined, undefined, newValue);
859
+ this.closePanel();
867
860
  if (isRangeValueComplete) {
868
861
  const {
869
862
  notifyValue,
@@ -378,9 +378,16 @@ class SelectFoundation extends _foundation.default {
378
378
  closeCb,
379
379
  notToggleInput
380
380
  } = closeConfig || {};
381
+ const {
382
+ isFocus
383
+ } = this.getStates();
381
384
  this._adapter.closeMenu();
382
385
  this._adapter.notifyDropdownVisibleChange(false);
383
386
  this._adapter.setIsFocusInContainer(false);
387
+ if (isFocus) {
388
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
389
+ this._focusTrigger();
390
+ }
384
391
  // this.unBindKeyBoardEvent();
385
392
  // this._notifyBlur(e);
386
393
  // this._adapter.updateFocusState(false);
@@ -411,7 +418,6 @@ class SelectFoundation extends _foundation.default {
411
418
  const isMultiple = this._isMultiple();
412
419
  if (!isMultiple) {
413
420
  this._handleSingleSelect(option, event);
414
- this._focusTrigger();
415
421
  } else {
416
422
  this._handleMultipleSelect(option, event);
417
423
  }
@@ -359,7 +359,7 @@
359
359
  .semi-cascader-option-lists .semi-cascader-option-icon {
360
360
  display: inline-flex;
361
361
  flex-shrink: 0;
362
- width: 32px;
362
+ width: 16px;
363
363
  color: var(--semi-color-text-2);
364
364
  }
365
365
  .semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
@@ -369,13 +369,13 @@
369
369
  margin-left: 8px;
370
370
  }
371
371
  .semi-cascader-option-lists .semi-cascader-option-spin-icon {
372
- width: 32px;
373
- height: 32px;
372
+ width: 16px;
373
+ height: 16px;
374
374
  line-height: 0;
375
375
  }
376
376
  .semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
377
- width: 32px;
378
- height: 32px;
377
+ width: 16px;
378
+ height: 16px;
379
379
  }
380
380
  .semi-cascader-option-lists .semi-cascader-option-label {
381
381
  display: flex;
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
436
436
  &-icon {
437
437
  display: inline-flex;
438
438
  flex-shrink: 0;
439
- width: $width-cascader-icon;
439
+ width:$width-cascader-option-icon;
440
440
  color: $color-cascader_option-icon-default;
441
441
 
442
442
  &-active,
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
450
450
  }
451
451
 
452
452
  &-spin-icon {
453
- width: $width-cascader-icon;
454
- height: $width-cascader-icon;
453
+ width: $width-cascader-option-icon;
454
+ height: $width-cascader-option-icon;
455
455
  line-height: 0;
456
456
 
457
457
  & svg {
458
- width: $width-cascader-icon;
459
- height: $width-cascader-icon;
458
+ width: $width-cascader-option-icon;
459
+ height: $width-cascader-option-icon;
460
460
  }
461
461
  }
462
462
 
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
92
92
  $width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
93
93
  $width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
94
94
  $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
95
- $width-cascader-icon: 32px; // 级联选择图标尺寸
95
+ $width-cascader-icon: 32px; // 级联选择触发器图标尺寸
96
+ $width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
96
97
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
97
98
  $height-cascader_option_list: 180px; // 级联选择菜单高度
98
99
  $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
@@ -190,7 +190,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
190
190
  * task 2. When the input box changes, update the date value = > Notify the change
191
191
  */
192
192
  export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
193
- clickConfirmButton: boolean;
194
193
  constructor(adapter: DatePickerAdapter);
195
194
  init(): void;
196
195
  initFromProps({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps, 'value' | 'timeZone'> & {
@@ -247,11 +246,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
247
246
  * - date type and not multiple, close panel after select date
248
247
  * - dateRange type, close panel after select rangeStart and rangeEnd
249
248
  * 4. click outside
250
- * @param {Event} e
251
- * @param {String} inputValue
252
- * @param {Date[]} dates
253
249
  */
254
- closePanel(e?: any, inputValue?: string, dates?: Date[]): void;
250
+ closePanel(): void;
255
251
  open(): void;
256
252
  close(): void;
257
253
  focus(focusType?: Exclude<RangeType, false>): void;
@@ -259,7 +255,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
259
255
  /**
260
256
  * reset cachedSelectedValue, inputValue when close panel
261
257
  */
262
- resetInnerSelectedStates(willUpdateDates?: Date[]): void;
258
+ resetInnerSelectedStates(): void;
263
259
  resetFocus(e?: any): void;
264
260
  /**
265
261
  * cachedSelectedValue can be `(Date|null)[]` or `null`
@@ -210,21 +210,12 @@ export default class DatePickerFoundation extends BaseFoundation {
210
210
  * - date type and not multiple, close panel after select date
211
211
  * - dateRange type, close panel after select rangeStart and rangeEnd
212
212
  * 4. click outside
213
- * @param {Event} e
214
- * @param {String} inputValue
215
- * @param {Date[]} dates
216
213
  */
217
- closePanel(e) {
218
- let inputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
219
- let dates = arguments.length > 2 ? arguments[2] : undefined;
220
- const {
221
- value
222
- } = this._adapter.getStates();
223
- const willUpdateDates = isNullOrUndefined(dates) ? value : dates;
214
+ closePanel() {
224
215
  if (!this._isControlledComponent('open')) {
225
216
  this.close();
226
217
  } else {
227
- this.resetInnerSelectedStates(willUpdateDates);
218
+ this.resetInnerSelectedStates();
228
219
  }
229
220
  this._adapter.notifyOpenChange(false);
230
221
  }
@@ -233,7 +224,8 @@ export default class DatePickerFoundation extends BaseFoundation {
233
224
  this._adapter.registerClickOutSide();
234
225
  }
235
226
  close() {
236
- this._adapter.togglePanel(false, () => this.resetInnerSelectedStates());
227
+ this._adapter.togglePanel(false);
228
+ this.resetInnerSelectedStates();
237
229
  this._adapter.unregisterClickOutSide();
238
230
  }
239
231
  focus(focusType) {
@@ -254,17 +246,19 @@ export default class DatePickerFoundation extends BaseFoundation {
254
246
  /**
255
247
  * reset cachedSelectedValue, inputValue when close panel
256
248
  */
257
- resetInnerSelectedStates(willUpdateDates) {
258
- const {
259
- value
260
- } = this._adapter.getStates();
261
- const needResetCachedSelectedValue = isNullOrUndefined(willUpdateDates) || !this.isCachedSelectedValueValid(willUpdateDates) || this._adapter.needConfirm() && !this.clickConfirmButton;
262
- if (needResetCachedSelectedValue) {
263
- this.resetCachedSelectedValue(value);
264
- }
249
+ resetInnerSelectedStates() {
250
+ // 通过 setTimeout 保证需要获取到最新的 state 状态
251
+ setTimeout(() => {
252
+ const {
253
+ value,
254
+ cachedSelectedValue
255
+ } = this._adapter.getStates();
256
+ if (!_isEqual(value, cachedSelectedValue)) {
257
+ this.resetCachedSelectedValue(value);
258
+ }
259
+ }, 0);
265
260
  this.resetFocus();
266
261
  this.clearInputValue();
267
- this.clickConfirmButton = false;
268
262
  }
269
263
  resetFocus(e) {
270
264
  this._adapter.setRangeInputFocus(false);
@@ -818,7 +812,7 @@ export default class DatePickerFoundation extends BaseFoundation {
818
812
  }
819
813
  const focusRecordChecked = !needCheckFocusRecord || needCheckFocusRecord && this._adapter.couldPanelClosed();
820
814
  if (type === 'date' && !this._isMultiple() && closePanel || type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked) {
821
- this.closePanel(undefined, inputValue, dates);
815
+ this.closePanel();
822
816
  }
823
817
  }
824
818
  /**
@@ -845,7 +839,6 @@ export default class DatePickerFoundation extends BaseFoundation {
845
839
  }
846
840
  }
847
841
  handleConfirm() {
848
- this.clickConfirmButton = true;
849
842
  const {
850
843
  cachedSelectedValue,
851
844
  value
@@ -856,7 +849,7 @@ export default class DatePickerFoundation extends BaseFoundation {
856
849
  this._adapter.updateValue(newValue);
857
850
  }
858
851
  // If the input is incomplete, the legal date of the last input is used
859
- this.closePanel(undefined, undefined, newValue);
852
+ this.closePanel();
860
853
  if (isRangeValueComplete) {
861
854
  const {
862
855
  notifyValue,
@@ -369,9 +369,16 @@ export default class SelectFoundation extends BaseFoundation {
369
369
  closeCb,
370
370
  notToggleInput
371
371
  } = closeConfig || {};
372
+ const {
373
+ isFocus
374
+ } = this.getStates();
372
375
  this._adapter.closeMenu();
373
376
  this._adapter.notifyDropdownVisibleChange(false);
374
377
  this._adapter.setIsFocusInContainer(false);
378
+ if (isFocus) {
379
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
380
+ this._focusTrigger();
381
+ }
375
382
  // this.unBindKeyBoardEvent();
376
383
  // this._notifyBlur(e);
377
384
  // this._adapter.updateFocusState(false);
@@ -402,7 +409,6 @@ export default class SelectFoundation extends BaseFoundation {
402
409
  const isMultiple = this._isMultiple();
403
410
  if (!isMultiple) {
404
411
  this._handleSingleSelect(option, event);
405
- this._focusTrigger();
406
412
  } else {
407
413
  this._handleMultipleSelect(option, event);
408
414
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.67.2-alpha.1",
3
+ "version": "2.67.2",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.67.0",
10
+ "@douyinfe/semi-animation": "2.67.2",
11
11
  "@mdx-js/mdx": "^3.0.1",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
@@ -28,7 +28,7 @@
28
28
  "*.scss",
29
29
  "*.css"
30
30
  ],
31
- "gitHead": "3f08368852c402daca35bf5ff4a192e841ea4dd3",
31
+ "gitHead": "2ff1f1c65aa51266782304dfd1dea055d20ee028",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
@@ -400,9 +400,14 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
400
400
  close(closeConfig?: { event?: any; closeCb?: () => void; notToggleInput?: boolean }) {
401
401
  // to support A11y, closing the panel trigger does not necessarily lose focus
402
402
  const { event, closeCb, notToggleInput } = closeConfig || {};
403
+ const { isFocus } = this.getStates();
403
404
  this._adapter.closeMenu();
404
405
  this._adapter.notifyDropdownVisibleChange(false);
405
406
  this._adapter.setIsFocusInContainer(false);
407
+ if (isFocus) {
408
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
409
+ this._focusTrigger();
410
+ }
406
411
  // this.unBindKeyBoardEvent();
407
412
  // this._notifyBlur(e);
408
413
  // this._adapter.updateFocusState(false);
@@ -438,7 +443,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
438
443
  const isMultiple = this._isMultiple();
439
444
  if (!isMultiple) {
440
445
  this._handleSingleSelect(option, event);
441
- this._focusTrigger();
442
446
  } else {
443
447
  this._handleMultipleSelect(option, event);
444
448
  }