@rc-component/select 1.6.9 → 1.6.10

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.
@@ -230,7 +230,9 @@ const BaseSelect = /*#__PURE__*/React.forwardRef((props, ref) => {
230
230
  // Enter or Space opens dropdown (ARIA combobox: spacebar should open)
231
231
  if (isEnterKey || isSpaceKey) {
232
232
  // Do not submit form when type in the input; prevent Space from scrolling page
233
- if (mode !== 'combobox') {
233
+ const isCombobox = mode === 'combobox';
234
+ const isEditable = isCombobox || showSearch;
235
+ if (isSpaceKey && !isEditable || isEnterKey && !isCombobox) {
234
236
  event.preventDefault();
235
237
  }
236
238
 
@@ -239,7 +239,9 @@ const BaseSelect = /*#__PURE__*/React.forwardRef((props, ref) => {
239
239
  // Enter or Space opens dropdown (ARIA combobox: spacebar should open)
240
240
  if (isEnterKey || isSpaceKey) {
241
241
  // Do not submit form when type in the input; prevent Space from scrolling page
242
- if (mode !== 'combobox') {
242
+ const isCombobox = mode === 'combobox';
243
+ const isEditable = isCombobox || showSearch;
244
+ if (isSpaceKey && !isEditable || isEnterKey && !isCombobox) {
243
245
  event.preventDefault();
244
246
  }
245
247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/select",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "description": "React Select",
5
5
  "engines": {
6
6
  "node": ">=8.x"