downshift 6.1.10 → 6.1.11

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.
@@ -2204,7 +2204,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
2204
2204
  switch (type) {
2205
2205
  case stateChangeTypes.ItemMouseMove:
2206
2206
  changes = {
2207
- highlightedIndex: action.index
2207
+ highlightedIndex: action.disabled ? -1 : action.index
2208
2208
  };
2209
2209
  break;
2210
2210
 
@@ -2953,6 +2953,7 @@ function useSelect(userProps) {
2953
2953
  onClick,
2954
2954
  refKey = 'ref',
2955
2955
  ref,
2956
+ disabled,
2956
2957
  ...rest
2957
2958
  } = _temp5 === void 0 ? {} : _temp5;
2958
2959
  const {
@@ -2968,7 +2969,8 @@ function useSelect(userProps) {
2968
2969
  shouldScrollRef.current = false;
2969
2970
  dispatch({
2970
2971
  type: ItemMouseMove$1,
2971
- index
2972
+ index,
2973
+ disabled
2972
2974
  });
2973
2975
  };
2974
2976
 
@@ -2986,6 +2988,7 @@ function useSelect(userProps) {
2986
2988
  }
2987
2989
 
2988
2990
  const itemProps = {
2991
+ disabled,
2989
2992
  role: 'option',
2990
2993
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
2991
2994
  id: elementIds.getItemId(itemIndex),
@@ -2997,11 +3000,11 @@ function useSelect(userProps) {
2997
3000
  ...rest
2998
3001
  };
2999
3002
 
3000
- if (!rest.disabled) {
3001
- itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
3003
+ if (!disabled) {
3002
3004
  itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
3003
3005
  }
3004
3006
 
3007
+ itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
3005
3008
  return itemProps;
3006
3009
  }, [dispatch, latest, shouldScrollRef, elementIds]);
3007
3010
  return {
@@ -3528,6 +3531,7 @@ function useCombobox(userProps) {
3528
3531
  onMouseMove,
3529
3532
  onClick,
3530
3533
  onPress,
3534
+ disabled,
3531
3535
  ...rest
3532
3536
  } = _temp3 === void 0 ? {} : _temp3;
3533
3537
  const {
@@ -3551,7 +3555,8 @@ function useCombobox(userProps) {
3551
3555
  shouldScrollRef.current = false;
3552
3556
  dispatch({
3553
3557
  type: ItemMouseMove,
3554
- index
3558
+ index,
3559
+ disabled
3555
3560
  });
3556
3561
  };
3557
3562
 
@@ -3572,13 +3577,14 @@ function useCombobox(userProps) {
3572
3577
  itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
3573
3578
  }
3574
3579
  }),
3580
+ disabled,
3575
3581
  role: 'option',
3576
3582
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
3577
3583
  id: elementIds.getItemId(itemIndex),
3578
- ...(!rest.disabled && {
3579
- onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3584
+ ...(!disabled && {
3580
3585
  [onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
3581
3586
  }),
3587
+ onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3582
3588
  ...rest
3583
3589
  };
3584
3590
  }, [dispatch, latest, shouldScrollRef, elementIds]);
@@ -2195,7 +2195,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
2195
2195
  switch (type) {
2196
2196
  case stateChangeTypes.ItemMouseMove:
2197
2197
  changes = {
2198
- highlightedIndex: action.index
2198
+ highlightedIndex: action.disabled ? -1 : action.index
2199
2199
  };
2200
2200
  break;
2201
2201
 
@@ -2944,6 +2944,7 @@ function useSelect(userProps) {
2944
2944
  onClick,
2945
2945
  refKey = 'ref',
2946
2946
  ref,
2947
+ disabled,
2947
2948
  ...rest
2948
2949
  } = _temp5 === void 0 ? {} : _temp5;
2949
2950
  const {
@@ -2959,7 +2960,8 @@ function useSelect(userProps) {
2959
2960
  shouldScrollRef.current = false;
2960
2961
  dispatch({
2961
2962
  type: ItemMouseMove$1,
2962
- index
2963
+ index,
2964
+ disabled
2963
2965
  });
2964
2966
  };
2965
2967
 
@@ -2977,6 +2979,7 @@ function useSelect(userProps) {
2977
2979
  }
2978
2980
 
2979
2981
  const itemProps = {
2982
+ disabled,
2980
2983
  role: 'option',
2981
2984
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
2982
2985
  id: elementIds.getItemId(itemIndex),
@@ -2988,11 +2991,11 @@ function useSelect(userProps) {
2988
2991
  ...rest
2989
2992
  };
2990
2993
 
2991
- if (!rest.disabled) {
2992
- itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
2994
+ if (!disabled) {
2993
2995
  itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
2994
2996
  }
2995
2997
 
2998
+ itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
2996
2999
  return itemProps;
2997
3000
  }, [dispatch, latest, shouldScrollRef, elementIds]);
2998
3001
  return {
@@ -3519,6 +3522,7 @@ function useCombobox(userProps) {
3519
3522
  onMouseMove,
3520
3523
  onClick,
3521
3524
  onPress,
3525
+ disabled,
3522
3526
  ...rest
3523
3527
  } = _temp3 === void 0 ? {} : _temp3;
3524
3528
  const {
@@ -3542,7 +3546,8 @@ function useCombobox(userProps) {
3542
3546
  shouldScrollRef.current = false;
3543
3547
  dispatch({
3544
3548
  type: ItemMouseMove,
3545
- index
3549
+ index,
3550
+ disabled
3546
3551
  });
3547
3552
  };
3548
3553
 
@@ -3563,13 +3568,14 @@ function useCombobox(userProps) {
3563
3568
  itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
3564
3569
  }
3565
3570
  }),
3571
+ disabled,
3566
3572
  role: 'option',
3567
3573
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
3568
3574
  id: elementIds.getItemId(itemIndex),
3569
- ...(!rest.disabled && {
3570
- onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3575
+ ...(!disabled && {
3571
3576
  [onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
3572
3577
  }),
3578
+ onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3573
3579
  ...rest
3574
3580
  };
3575
3581
  }, [dispatch, latest, shouldScrollRef, elementIds]);
@@ -2135,7 +2135,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
2135
2135
  switch (type) {
2136
2136
  case stateChangeTypes.ItemMouseMove:
2137
2137
  changes = {
2138
- highlightedIndex: action.index
2138
+ highlightedIndex: action.disabled ? -1 : action.index
2139
2139
  };
2140
2140
  break;
2141
2141
 
@@ -2884,6 +2884,7 @@ function useSelect(userProps) {
2884
2884
  onClick,
2885
2885
  refKey = 'ref',
2886
2886
  ref,
2887
+ disabled,
2887
2888
  ...rest
2888
2889
  } = _temp5 === void 0 ? {} : _temp5;
2889
2890
  const {
@@ -2899,7 +2900,8 @@ function useSelect(userProps) {
2899
2900
  shouldScrollRef.current = false;
2900
2901
  dispatch({
2901
2902
  type: ItemMouseMove$1,
2902
- index
2903
+ index,
2904
+ disabled
2903
2905
  });
2904
2906
  };
2905
2907
 
@@ -2917,6 +2919,7 @@ function useSelect(userProps) {
2917
2919
  }
2918
2920
 
2919
2921
  const itemProps = {
2922
+ disabled,
2920
2923
  role: 'option',
2921
2924
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
2922
2925
  id: elementIds.getItemId(itemIndex),
@@ -2928,11 +2931,11 @@ function useSelect(userProps) {
2928
2931
  ...rest
2929
2932
  };
2930
2933
 
2931
- if (!rest.disabled) {
2932
- itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
2934
+ if (!disabled) {
2933
2935
  itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
2934
2936
  }
2935
2937
 
2938
+ itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
2936
2939
  return itemProps;
2937
2940
  }, [dispatch, latest, shouldScrollRef, elementIds]);
2938
2941
  return {
@@ -3459,6 +3462,7 @@ function useCombobox(userProps) {
3459
3462
  onMouseMove,
3460
3463
  onClick,
3461
3464
  onPress,
3465
+ disabled,
3462
3466
  ...rest
3463
3467
  } = _temp3 === void 0 ? {} : _temp3;
3464
3468
  const {
@@ -3484,7 +3488,8 @@ function useCombobox(userProps) {
3484
3488
  shouldScrollRef.current = false;
3485
3489
  dispatch({
3486
3490
  type: ItemMouseMove,
3487
- index
3491
+ index,
3492
+ disabled
3488
3493
  });
3489
3494
  };
3490
3495
 
@@ -3505,13 +3510,14 @@ function useCombobox(userProps) {
3505
3510
  itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
3506
3511
  }
3507
3512
  }),
3513
+ disabled,
3508
3514
  role: 'option',
3509
3515
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
3510
3516
  id: elementIds.getItemId(itemIndex),
3511
- ...(!rest.disabled && {
3512
- onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3517
+ ...(!disabled && {
3513
3518
  [onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
3514
3519
  }),
3520
+ onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
3515
3521
  ...rest
3516
3522
  };
3517
3523
  }, [dispatch, latest, shouldScrollRef, elementIds]);
@@ -3446,7 +3446,7 @@
3446
3446
  switch (type) {
3447
3447
  case stateChangeTypes.ItemMouseMove:
3448
3448
  changes = {
3449
- highlightedIndex: action.index
3449
+ highlightedIndex: action.disabled ? -1 : action.index
3450
3450
  };
3451
3451
  break;
3452
3452
 
@@ -4221,6 +4221,7 @@
4221
4221
  onClick,
4222
4222
  refKey = 'ref',
4223
4223
  ref,
4224
+ disabled,
4224
4225
  ...rest
4225
4226
  } = _temp5 === void 0 ? {} : _temp5;
4226
4227
  const {
@@ -4236,7 +4237,8 @@
4236
4237
  shouldScrollRef.current = false;
4237
4238
  dispatch({
4238
4239
  type: ItemMouseMove$1,
4239
- index
4240
+ index,
4241
+ disabled
4240
4242
  });
4241
4243
  };
4242
4244
 
@@ -4254,6 +4256,7 @@
4254
4256
  }
4255
4257
 
4256
4258
  const itemProps = {
4259
+ disabled,
4257
4260
  role: 'option',
4258
4261
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
4259
4262
  id: elementIds.getItemId(itemIndex),
@@ -4265,11 +4268,11 @@
4265
4268
  ...rest
4266
4269
  };
4267
4270
 
4268
- if (!rest.disabled) {
4269
- itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
4271
+ if (!disabled) {
4270
4272
  itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
4271
4273
  }
4272
4274
 
4275
+ itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
4273
4276
  return itemProps;
4274
4277
  }, [dispatch, latest, shouldScrollRef, elementIds]);
4275
4278
  return {
@@ -4796,6 +4799,7 @@
4796
4799
  onMouseMove,
4797
4800
  onClick,
4798
4801
  onPress,
4802
+ disabled,
4799
4803
  ...rest
4800
4804
  } = _temp3 === void 0 ? {} : _temp3;
4801
4805
  const {
@@ -4819,7 +4823,8 @@
4819
4823
  shouldScrollRef.current = false;
4820
4824
  dispatch({
4821
4825
  type: ItemMouseMove,
4822
- index
4826
+ index,
4827
+ disabled
4823
4828
  });
4824
4829
  };
4825
4830
 
@@ -4840,13 +4845,14 @@
4840
4845
  itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
4841
4846
  }
4842
4847
  }),
4848
+ disabled,
4843
4849
  role: 'option',
4844
4850
  'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
4845
4851
  id: elementIds.getItemId(itemIndex),
4846
- ...(!rest.disabled && {
4847
- onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
4852
+ ...(!disabled && {
4848
4853
  [onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
4849
4854
  }),
4855
+ onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
4850
4856
  ...rest
4851
4857
  };
4852
4858
  }, [dispatch, latest, shouldScrollRef, elementIds]);