carbon-react 119.6.3 → 119.6.4

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.
@@ -108,7 +108,7 @@ const Events = {
108
108
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
109
109
  */
110
110
  composedPath: ev => {
111
- return ev.detail && ev.detail.enzymeTestingTarget && composedPath(ev) || ev.composedPath && ev.composedPath() || composedPath(ev);
111
+ return ev.detail?.enzymeTestingTarget && composedPath(ev) || ev.composedPath && ev.composedPath() || composedPath(ev);
112
112
  }
113
113
  };
114
114
  export default Events;
@@ -176,14 +176,17 @@ const Submenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
176
176
  } else {
177
177
  setCharacterString("");
178
178
  }
179
- if (Events.isEnterKey(event)) {
180
- /* timeout enforces that the "closeSubmenu" method will be run after
181
- the browser navigates to the specified href of the menu-item. */
182
- setTimeout(() => closeSubmenu());
183
- }
184
- if (href && Events.isEnterKey(event)) {
185
- closeSubmenu();
186
- return;
179
+ const eventIsFromInput = Events.composedPath(event).find(p => p.getAttribute("data-element") === "input" || p.getAttribute("data-element") === "input-icon-toggle");
180
+ if (!eventIsFromInput) {
181
+ if (Events.isEnterKey(event)) {
182
+ /* timeout enforces that the "closeSubmenu" method will be run after
183
+ the browser navigates to the specified href of the menu-item. */
184
+ setTimeout(() => closeSubmenu(), 0);
185
+ }
186
+ if (href && Events.isEnterKey(event)) {
187
+ closeSubmenu();
188
+ return;
189
+ }
187
190
  }
188
191
  if (nextIndex !== index) {
189
192
  setSubmenuFocusId(submenuItemIds[nextIndex]);
@@ -114,7 +114,7 @@ const Events = {
114
114
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
115
115
  */
116
116
  composedPath: ev => {
117
- return ev.detail && ev.detail.enzymeTestingTarget && (0, _composedPath.default)(ev) || ev.composedPath && ev.composedPath() || (0, _composedPath.default)(ev);
117
+ return ev.detail?.enzymeTestingTarget && (0, _composedPath.default)(ev) || ev.composedPath && ev.composedPath() || (0, _composedPath.default)(ev);
118
118
  }
119
119
  };
120
120
  var _default = Events;
@@ -185,14 +185,17 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
185
185
  } else {
186
186
  setCharacterString("");
187
187
  }
188
- if (_events.default.isEnterKey(event)) {
189
- /* timeout enforces that the "closeSubmenu" method will be run after
190
- the browser navigates to the specified href of the menu-item. */
191
- setTimeout(() => closeSubmenu());
192
- }
193
- if (href && _events.default.isEnterKey(event)) {
194
- closeSubmenu();
195
- return;
188
+ const eventIsFromInput = _events.default.composedPath(event).find(p => p.getAttribute("data-element") === "input" || p.getAttribute("data-element") === "input-icon-toggle");
189
+ if (!eventIsFromInput) {
190
+ if (_events.default.isEnterKey(event)) {
191
+ /* timeout enforces that the "closeSubmenu" method will be run after
192
+ the browser navigates to the specified href of the menu-item. */
193
+ setTimeout(() => closeSubmenu(), 0);
194
+ }
195
+ if (href && _events.default.isEnterKey(event)) {
196
+ closeSubmenu();
197
+ return;
198
+ }
196
199
  }
197
200
  if (nextIndex !== index) {
198
201
  setSubmenuFocusId(submenuItemIds[nextIndex]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "119.6.3",
3
+ "version": "119.6.4",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",