@carbon/react 1.71.0 → 1.71.1

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.
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import findLast from 'lodash.findlast';
9
8
  import { useEffect } from 'react';
10
9
  import { DOCUMENT_POSITION_BROAD_PRECEDING, selectorTabbable, DOCUMENT_POSITION_BROAD_FOLLOWING } from './keyboard/navigation.js';
11
10
  import { tabbable } from 'tabbable';
@@ -45,7 +44,7 @@ function wrapFocus(_ref) {
45
44
  if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
46
45
  const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
47
46
  if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
48
- const tabbable = findLast(bodyNode.querySelectorAll(selectorTabbable), elem => Boolean(elem.offsetParent));
47
+ const tabbable = [...bodyNode.querySelectorAll(selectorTabbable)].reverse().find(elem => Boolean(elem.offsetParent));
49
48
  if (tabbable) {
50
49
  tabbable.focus();
51
50
  } else if (bodyNode !== oldActiveNode) {
@@ -9,15 +9,10 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var findLast = require('lodash.findlast');
13
12
  var React = require('react');
14
13
  var navigation = require('./keyboard/navigation.js');
15
14
  var tabbable = require('tabbable');
16
15
 
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- var findLast__default = /*#__PURE__*/_interopDefaultLegacy(findLast);
20
-
21
16
  /**
22
17
  * @param {Node} node A DOM node.
23
18
  * @param {string[]} selectorsFloatingMenus The CSS selectors that matches floating menus.
@@ -53,7 +48,7 @@ function wrapFocus(_ref) {
53
48
  if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
54
49
  const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
55
50
  if (currentActiveNode === startTrapNode || comparisonResult & navigation.DOCUMENT_POSITION_BROAD_PRECEDING) {
56
- const tabbable = findLast__default["default"](bodyNode.querySelectorAll(navigation.selectorTabbable), elem => Boolean(elem.offsetParent));
51
+ const tabbable = [...bodyNode.querySelectorAll(navigation.selectorTabbable)].reverse().find(elem => Boolean(elem.offsetParent));
57
52
  if (tabbable) {
58
53
  tabbable.focus();
59
54
  } else if (bodyNode !== oldActiveNode) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/react",
3
3
  "description": "React components for the Carbon Design System",
4
- "version": "1.71.0",
4
+ "version": "1.71.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -61,7 +61,6 @@
61
61
  "flatpickr": "4.6.13",
62
62
  "invariant": "^2.2.3",
63
63
  "lodash.debounce": "^4.0.8",
64
- "lodash.findlast": "^4.5.0",
65
64
  "lodash.omit": "^4.5.0",
66
65
  "lodash.throttle": "^4.1.1",
67
66
  "prop-types": "^15.7.2",
@@ -146,5 +145,5 @@
146
145
  "**/*.scss",
147
146
  "**/*.css"
148
147
  ],
149
- "gitHead": "ab3eba8531c341d5ee5d956b962d7cce04944ac3"
148
+ "gitHead": "c0223bda5d6b6f30b20631cf5b8ea0ec45fd39b3"
150
149
  }