instantsearch.js 4.64.1 → 4.64.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.
@@ -29,6 +29,7 @@ var defaultProps = {
29
29
  showLoadingIndicator: true,
30
30
  autofocus: false,
31
31
  searchAsYouType: true,
32
+ ignoreCompositionEvents: false,
32
33
  isSearchStalled: false,
33
34
  disabled: false,
34
35
  ariaLabel: 'Search',
@@ -58,7 +59,7 @@ var SearchBox = /*#__PURE__*/function (_Component) {
58
59
  refine = _this$props.refine,
59
60
  onChange = _this$props.onChange;
60
61
  var query = event.target.value;
61
- if (event.type === 'compositionend' || !event.isComposing) {
62
+ if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {
62
63
  if (searchAsYouType) {
63
64
  refine(query);
64
65
  }
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '4.64.1';
7
+ var _default = '4.64.2';
8
8
  exports.default = _default;
@@ -29,6 +29,7 @@ var renderer = function renderer(_ref) {
29
29
  templates = _ref.templates,
30
30
  autofocus = _ref.autofocus,
31
31
  searchAsYouType = _ref.searchAsYouType,
32
+ ignoreCompositionEvents = _ref.ignoreCompositionEvents,
32
33
  showReset = _ref.showReset,
33
34
  showSubmit = _ref.showSubmit,
34
35
  showLoadingIndicator = _ref.showLoadingIndicator;
@@ -42,6 +43,7 @@ var renderer = function renderer(_ref) {
42
43
  autofocus: autofocus,
43
44
  refine: refine,
44
45
  searchAsYouType: searchAsYouType,
46
+ ignoreCompositionEvents: ignoreCompositionEvents,
45
47
  templates: templates,
46
48
  showSubmit: showSubmit,
47
49
  showReset: showReset,
@@ -72,6 +74,8 @@ var searchBox = function searchBox(widgetParams) {
72
74
  autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,
73
75
  _ref3$searchAsYouType = _ref3.searchAsYouType,
74
76
  searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,
77
+ _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,
78
+ ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,
75
79
  _ref3$showReset = _ref3.showReset,
76
80
  showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,
77
81
  _ref3$showSubmit = _ref3.showSubmit,
@@ -120,6 +124,7 @@ var searchBox = function searchBox(widgetParams) {
120
124
  templates: templates,
121
125
  autofocus: autofocus,
122
126
  searchAsYouType: searchAsYouType,
127
+ ignoreCompositionEvents: ignoreCompositionEvents,
123
128
  showReset: showReset,
124
129
  showSubmit: showSubmit,
125
130
  showLoadingIndicator: showLoadingIndicator
@@ -4822,6 +4822,12 @@ declare type SearchBoxWidgetParams = {
4822
4822
  * once `<Enter>` is pressed only.
4823
4823
  */
4824
4824
  searchAsYouType?: boolean;
4825
+ /**
4826
+ * Whether to update the search state in the middle of a
4827
+ * composition session.
4828
+ * @default false
4829
+ */
4830
+ ignoreCompositionEvents?: boolean;
4825
4831
  /**
4826
4832
  * Whether to show the reset button
4827
4833
  */
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.64.1 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! InstantSearch.js 4.64.2 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -14890,7 +14890,7 @@
14890
14890
  };
14891
14891
  }
14892
14892
 
14893
- var version$1 = '4.64.1';
14893
+ var version$1 = '4.64.2';
14894
14894
 
14895
14895
  var withUsage$r = createDocumentationMessageGenerator({
14896
14896
  name: 'instantsearch'
@@ -18039,6 +18039,7 @@
18039
18039
  showLoadingIndicator: true,
18040
18040
  autofocus: false,
18041
18041
  searchAsYouType: true,
18042
+ ignoreCompositionEvents: false,
18042
18043
  isSearchStalled: false,
18043
18044
  disabled: false,
18044
18045
  ariaLabel: 'Search',
@@ -18068,7 +18069,7 @@
18068
18069
  refine = _this$props.refine,
18069
18070
  onChange = _this$props.onChange;
18070
18071
  var query = event.target.value;
18071
- if (event.type === 'compositionend' || !event.isComposing) {
18072
+ if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {
18072
18073
  if (searchAsYouType) {
18073
18074
  refine(query);
18074
18075
  }
@@ -21826,6 +21827,7 @@
21826
21827
  templates = _ref.templates,
21827
21828
  autofocus = _ref.autofocus,
21828
21829
  searchAsYouType = _ref.searchAsYouType,
21830
+ ignoreCompositionEvents = _ref.ignoreCompositionEvents,
21829
21831
  showReset = _ref.showReset,
21830
21832
  showSubmit = _ref.showSubmit,
21831
21833
  showLoadingIndicator = _ref.showLoadingIndicator;
@@ -21839,6 +21841,7 @@
21839
21841
  autofocus: autofocus,
21840
21842
  refine: refine,
21841
21843
  searchAsYouType: searchAsYouType,
21844
+ ignoreCompositionEvents: ignoreCompositionEvents,
21842
21845
  templates: templates,
21843
21846
  showSubmit: showSubmit,
21844
21847
  showReset: showReset,
@@ -21869,6 +21872,8 @@
21869
21872
  autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,
21870
21873
  _ref3$searchAsYouType = _ref3.searchAsYouType,
21871
21874
  searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,
21875
+ _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,
21876
+ ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,
21872
21877
  _ref3$showReset = _ref3.showReset,
21873
21878
  showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,
21874
21879
  _ref3$showSubmit = _ref3.showSubmit,
@@ -21917,6 +21922,7 @@
21917
21922
  templates: templates,
21918
21923
  autofocus: autofocus,
21919
21924
  searchAsYouType: searchAsYouType,
21925
+ ignoreCompositionEvents: ignoreCompositionEvents,
21920
21926
  showReset: showReset,
21921
21927
  showSubmit: showSubmit,
21922
21928
  showLoadingIndicator: showLoadingIndicator