carbon-react 146.2.0 → 146.2.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.
@@ -61,8 +61,13 @@ const StyledSubmenu = styled.ul`
61
61
  min-width: 100%;
62
62
 
63
63
  ${submenuMaxWidth && css`
64
+ width: max-content;
64
65
  max-width: ${submenuMaxWidth};
65
66
 
67
+ li {
68
+ max-width: ${submenuMaxWidth};
69
+ }
70
+
66
71
  &&& {
67
72
  a,
68
73
  button,
@@ -63,7 +63,8 @@ export const MenuItem = ({
63
63
  submenuFocusId,
64
64
  updateFocusId: updateSubmenuFocusId,
65
65
  handleKeyDown: handleSubmenuKeyDown,
66
- shiftTabPressed
66
+ shiftTabPressed,
67
+ submenuHasMaxWidth
67
68
  } = submenuContext;
68
69
  const ref = useRef(null);
69
70
  const focusFromMenu = focusId === menuItemId.current;
@@ -191,7 +192,7 @@ export const MenuItem = ({
191
192
  }, elementProps, {
192
193
  menuItemVariant: variant,
193
194
  ariaLabel: ariaLabel,
194
- maxWidth: maxWidth,
195
+ maxWidth: !submenuHasMaxWidth ? itemMaxWidth : undefined,
195
196
  inFullscreenView: inFullscreenView,
196
197
  asPassiveItem: asPassiveItem,
197
198
  placeholderTabIndex: asPassiveItem
@@ -70,8 +70,13 @@ const StyledSubmenu = exports.StyledSubmenu = _styledComponents.default.ul`
70
70
  min-width: 100%;
71
71
 
72
72
  ${submenuMaxWidth && (0, _styledComponents.css)`
73
+ width: max-content;
73
74
  max-width: ${submenuMaxWidth};
74
75
 
76
+ li {
77
+ max-width: ${submenuMaxWidth};
78
+ }
79
+
75
80
  &&& {
76
81
  a,
77
82
  button,
@@ -72,7 +72,8 @@ const MenuItem = ({
72
72
  submenuFocusId,
73
73
  updateFocusId: updateSubmenuFocusId,
74
74
  handleKeyDown: handleSubmenuKeyDown,
75
- shiftTabPressed
75
+ shiftTabPressed,
76
+ submenuHasMaxWidth
76
77
  } = submenuContext;
77
78
  const ref = (0, _react.useRef)(null);
78
79
  const focusFromMenu = focusId === menuItemId.current;
@@ -200,7 +201,7 @@ const MenuItem = ({
200
201
  }, elementProps, {
201
202
  menuItemVariant: variant,
202
203
  ariaLabel: ariaLabel,
203
- maxWidth: maxWidth,
204
+ maxWidth: !submenuHasMaxWidth ? itemMaxWidth : undefined,
204
205
  inFullscreenView: inFullscreenView,
205
206
  asPassiveItem: asPassiveItem,
206
207
  placeholderTabIndex: asPassiveItem
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "146.2.0",
3
+ "version": "146.2.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",