carbon-react 152.0.0 → 152.0.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.
@@ -26,7 +26,13 @@ const ContentEditor = ({
26
26
  "aria-labelledby": `${namespace}-label`,
27
27
  className: `${namespace}-editable`,
28
28
  "data-role": `${namespace}-editable`,
29
- onFocus: focusAtEnd
29
+ onFocus: event => {
30
+ // If the related target is not a toolbar button, focus at the end of the editor
31
+ /* istanbul ignore next */
32
+ if (!event.relatedTarget || !event.relatedTarget.classList.contains("toolbar-button")) {
33
+ focusAtEnd(event);
34
+ }
35
+ }
30
36
  /** The following are automatically added by Lexical but violate WCAG 4.1.2 Name, Role, Value and so have been overriden */,
31
37
  "aria-autocomplete": undefined,
32
38
  "aria-readonly": undefined
@@ -34,7 +34,8 @@ const BoldButton = ({
34
34
  isActive: isActive,
35
35
  "aria-pressed": isActive,
36
36
  "data-role": `${namespace}-bold-button`,
37
- tabIndex: 0
37
+ tabIndex: 0,
38
+ className: "toolbar-button"
38
39
  });
39
40
  };
40
41
  export default BoldButton;
@@ -34,7 +34,8 @@ const ItalicButton = ({
34
34
  isActive: isActive,
35
35
  "aria-pressed": isActive,
36
36
  "data-role": `${namespace}-italic-button`,
37
- tabIndex: -1
37
+ tabIndex: -1,
38
+ className: "toolbar-button"
38
39
  });
39
40
  };
40
41
  export default ItalicButton;
@@ -300,7 +300,8 @@ const ListControls = ({
300
300
  isActive: isULActive,
301
301
  "aria-pressed": isULActive,
302
302
  "data-role": `${namespace}-unordered-list-button`,
303
- tabIndex: -1
303
+ tabIndex: -1,
304
+ className: "toolbar-button"
304
305
  }), /*#__PURE__*/React.createElement(FormattingButton, {
305
306
  size: "small",
306
307
  "aria-label": locale.textEditor.orderedListAria(),
@@ -310,7 +311,8 @@ const ListControls = ({
310
311
  isActive: isOLActive,
311
312
  "aria-pressed": isOLActive,
312
313
  "data-role": `${namespace}-ordered-list-button`,
313
- tabIndex: -1
314
+ tabIndex: -1,
315
+ className: "toolbar-button"
314
316
  }));
315
317
  };
316
318
  export default ListControls;
@@ -34,7 +34,13 @@ const ContentEditor = ({
34
34
  "aria-labelledby": `${namespace}-label`,
35
35
  className: `${namespace}-editable`,
36
36
  "data-role": `${namespace}-editable`,
37
- onFocus: focusAtEnd
37
+ onFocus: event => {
38
+ // If the related target is not a toolbar button, focus at the end of the editor
39
+ /* istanbul ignore next */
40
+ if (!event.relatedTarget || !event.relatedTarget.classList.contains("toolbar-button")) {
41
+ focusAtEnd(event);
42
+ }
43
+ }
38
44
  /** The following are automatically added by Lexical but violate WCAG 4.1.2 Name, Role, Value and so have been overriden */,
39
45
  "aria-autocomplete": undefined,
40
46
  "aria-readonly": undefined
@@ -41,7 +41,8 @@ const BoldButton = ({
41
41
  isActive: isActive,
42
42
  "aria-pressed": isActive,
43
43
  "data-role": `${namespace}-bold-button`,
44
- tabIndex: 0
44
+ tabIndex: 0,
45
+ className: "toolbar-button"
45
46
  });
46
47
  };
47
48
  var _default = exports.default = BoldButton;
@@ -40,7 +40,8 @@ const ItalicButton = ({
40
40
  isActive: isActive,
41
41
  "aria-pressed": isActive,
42
42
  "data-role": `${namespace}-italic-button`,
43
- tabIndex: -1
43
+ tabIndex: -1,
44
+ className: "toolbar-button"
44
45
  });
45
46
  };
46
47
  var _default = exports.default = ItalicButton;
@@ -308,7 +308,8 @@ const ListControls = ({
308
308
  isActive: isULActive,
309
309
  "aria-pressed": isULActive,
310
310
  "data-role": `${namespace}-unordered-list-button`,
311
- tabIndex: -1
311
+ tabIndex: -1,
312
+ className: "toolbar-button"
312
313
  }), /*#__PURE__*/_react.default.createElement(_toolbar.FormattingButton, {
313
314
  size: "small",
314
315
  "aria-label": locale.textEditor.orderedListAria(),
@@ -318,7 +319,8 @@ const ListControls = ({
318
319
  isActive: isOLActive,
319
320
  "aria-pressed": isOLActive,
320
321
  "data-role": `${namespace}-ordered-list-button`,
321
- tabIndex: -1
322
+ tabIndex: -1,
323
+ className: "toolbar-button"
322
324
  }));
323
325
  };
324
326
  var _default = exports.default = ListControls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "152.0.0",
3
+ "version": "152.0.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",