@jobber/components 2.80.0 → 2.80.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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,25 @@ menu: Changelog
8
8
  All notable changes to this project will be documented in this file.
9
9
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
10
10
 
11
+ ## [2.80.2](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.80.1...@jobber/components@2.80.2) (2022-04-18)
12
+
13
+ **Note:** Version bump only for package @jobber/components
14
+
15
+
16
+
17
+
18
+
19
+ ## [2.80.1](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.80.0...@jobber/components@2.80.1) (2022-04-05)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * disable enter press on chip menu debounce ([#874](https://github.com/GetJobber/atlantis/issues/874)) ([569e4d3](https://github.com/GetJobber/atlantis/commit/569e4d317369fc6af12f2603d9212a159fb88602))
25
+
26
+
27
+
28
+
29
+
11
30
  # [2.80.0](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.79.0...@jobber/components@2.80.0) (2022-04-05)
12
31
 
13
32
 
@@ -277,6 +277,7 @@ function useInternalChipDismissible(_a) {
277
277
  }
278
278
 
279
279
  var menuId = uuid.v1();
280
+ // eslint-disable-next-line max-statements
280
281
  function useInternalChipDismissibleInput(_a) {
281
282
  var options = _a.options, _b = _a.isLoadingMore, isLoadingMore = _b === void 0 ? false : _b, onCustomOptionSelect = _a.onCustomOptionSelect, onOptionSelect = _a.onOptionSelect, onSearch = _a.onSearch;
282
283
  var _c = __chunk_1.__read(React.useState([]), 2), allOptions = _c[0], setAllOptions = _c[1];
@@ -284,6 +285,7 @@ function useInternalChipDismissibleInput(_a) {
284
285
  var _e = __chunk_1.__read(React.useState(false), 2), menuOpen = _e[0], setMenuOpen = _e[1];
285
286
  var _f = __chunk_1.__read(React.useState(0), 2), activeIndex = _f[0], setActiveIndex = _f[1];
286
287
  var _g = __chunk_1.__read(React.useState(false), 2), shouldCancelBlur = _g[0], setShouldCancelBlur = _g[1];
288
+ var _h = __chunk_1.__read(React.useState(false), 2), shouldCancelEnter = _h[0], setShouldCancelEnter = _h[1];
287
289
  var canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
288
290
  var maxOptionIndex = allOptions.length - 1;
289
291
  var liveAnnounce = hooks.useLiveAnnounce().liveAnnounce;
@@ -320,6 +322,7 @@ function useInternalChipDismissibleInput(_a) {
320
322
  handleSearchChange: function (event) {
321
323
  setActiveIndex(0);
322
324
  setSearchValue(event.currentTarget.value);
325
+ setShouldCancelEnter(true);
323
326
  },
324
327
  handleSetActiveOnMouseOver: function (index) {
325
328
  return function () { return setActiveIndex(index); };
@@ -338,7 +341,11 @@ function useInternalChipDismissibleInput(_a) {
338
341
  },
339
342
  handleKeyDown: function (event) {
340
343
  var callbacks = {
341
- Enter: function () { return actions.handleSelectOption(computed.activeOption); },
344
+ Enter: function () {
345
+ if (shouldCancelEnter)
346
+ return;
347
+ actions.handleSelectOption(computed.activeOption);
348
+ },
342
349
  Tab: function () { return actions.handleSelectOption(computed.activeOption); },
343
350
  ",": function () {
344
351
  if (searchValue.length === 0)
@@ -368,6 +375,7 @@ function useInternalChipDismissibleInput(_a) {
368
375
  handleDebouncedSearch: lodash.debounce(function () {
369
376
  onSearch && onSearch(searchValue);
370
377
  setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
378
+ setShouldCancelEnter(false);
371
379
  }, 300),
372
380
  };
373
381
  return __chunk_1.__assign(__chunk_1.__assign(__chunk_1.__assign(__chunk_1.__assign({}, actions), { activeIndex: activeIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "2.80.0",
3
+ "version": "2.80.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "dist/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@jobber/design": "^0.24.0",
20
+ "@jobber/design": "^0.24.1",
21
21
  "@jobber/formatters": "^0.2.0",
22
22
  "@jobber/hooks": "^1.11.0",
23
23
  "@popperjs/core": "^2.0.6",
@@ -85,5 +85,5 @@
85
85
  "> 1%",
86
86
  "IE 10"
87
87
  ],
88
- "gitHead": "74a06594d91c1808e47dad89994633817c3c55e0"
88
+ "gitHead": "c061d202928162a7588bab2a2b64b37426ffc488"
89
89
  }