@algolia/satellite 2.2.2 → 2.2.3
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.
@@ -199,7 +199,6 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
199
199
|
});
|
200
200
|
},
|
201
201
|
defaultHighlightedIndex: 0,
|
202
|
-
isOpen: inputValue ? items.length > 0 ? undefined : true : undefined,
|
203
202
|
getA11yStatusMessage: function getA11yStatusMessage(_ref2) {
|
204
203
|
var isOpen = _ref2.isOpen,
|
205
204
|
resultCount = _ref2.resultCount,
|
@@ -300,6 +299,12 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
300
299
|
// @ts-expect-error wrong type
|
301
300
|
evt.nativeEvent.preventDownshiftDefault = true;
|
302
301
|
}
|
302
|
+
|
303
|
+
// should not close the menu on Enter if there are no items matching the input value
|
304
|
+
if (combobox.isOpen && evt.key === "Enter" && items.length === 0 && inputValue.trim().length > 0) {
|
305
|
+
// @ts-expect-error wrong type
|
306
|
+
evt.nativeEvent.preventDownshiftDefault = true;
|
307
|
+
}
|
303
308
|
if (multiple && creatable && inputValue.trim().length > 0 && separatorKeys !== null && separatorKeys !== void 0 && separatorKeys.includes(evt.key)) {
|
304
309
|
evt.preventDefault();
|
305
310
|
var _createFromInputValue = createFromInputValue(options, inputValue),
|
@@ -89,7 +89,7 @@ var Modal = exports.Modal = function Modal(_ref) {
|
|
89
89
|
className: (0, _clsx["default"])(animate && !_prefersReducedMotion.prefersReducedMotion && (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["modal-animated"]))), (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["modal-overlay bg-grey-900/30 z-modalOverlay inset-0 fixed w-full h-full flex items-start justify-center overflow-x-hidden overflow-y-auto px-4 py-10"])))),
|
90
90
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Dialog.Content, {
|
91
91
|
ref: dialogContentRef,
|
92
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["modal-content"]))), SIZE_CLASSNAMES[size], centerY && (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["flex m-auto"])))),
|
92
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["modal-content"]))), SIZE_CLASSNAMES[size], centerY && (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["flex m-auto justify-center"])))),
|
93
93
|
"aria-describedby": undefined,
|
94
94
|
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
95
95
|
var _closeButtonRef$curre;
|
@@ -195,7 +195,6 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
195
195
|
});
|
196
196
|
},
|
197
197
|
defaultHighlightedIndex: 0,
|
198
|
-
isOpen: inputValue ? items.length > 0 ? undefined : true : undefined,
|
199
198
|
getA11yStatusMessage: function getA11yStatusMessage(_ref2) {
|
200
199
|
var isOpen = _ref2.isOpen,
|
201
200
|
resultCount = _ref2.resultCount,
|
@@ -296,6 +295,12 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
296
295
|
// @ts-expect-error wrong type
|
297
296
|
evt.nativeEvent.preventDownshiftDefault = true;
|
298
297
|
}
|
298
|
+
|
299
|
+
// should not close the menu on Enter if there are no items matching the input value
|
300
|
+
if (combobox.isOpen && evt.key === "Enter" && items.length === 0 && inputValue.trim().length > 0) {
|
301
|
+
// @ts-expect-error wrong type
|
302
|
+
evt.nativeEvent.preventDownshiftDefault = true;
|
303
|
+
}
|
299
304
|
if (multiple && creatable && inputValue.trim().length > 0 && separatorKeys !== null && separatorKeys !== void 0 && separatorKeys.includes(evt.key)) {
|
300
305
|
evt.preventDefault();
|
301
306
|
var _createFromInputValue = createFromInputValue(options, inputValue),
|
@@ -79,7 +79,7 @@ export var Modal = function Modal(_ref) {
|
|
79
79
|
className: cx(animate && !prefersReducedMotion && stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["modal-animated"]))), stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["modal-overlay bg-grey-900/30 z-modalOverlay inset-0 fixed w-full h-full flex items-start justify-center overflow-x-hidden overflow-y-auto px-4 py-10"])))),
|
80
80
|
children: /*#__PURE__*/_jsx(Dialog.Content, {
|
81
81
|
ref: dialogContentRef,
|
82
|
-
className: cx(stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["modal-content"]))), SIZE_CLASSNAMES[size], centerY && stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["flex m-auto"])))),
|
82
|
+
className: cx(stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["modal-content"]))), SIZE_CLASSNAMES[size], centerY && stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["flex m-auto justify-center"])))),
|
83
83
|
"aria-describedby": undefined,
|
84
84
|
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
85
85
|
var _closeButtonRef$curre;
|