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.
- package/esm/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js +7 -1
- package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.js +2 -1
- package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.js +2 -1
- package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.js +4 -2
- package/lib/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js +7 -1
- package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.js +2 -1
- package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.js +2 -1
- package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.js +4 -2
- package/package.json +1 -1
package/esm/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js
CHANGED
|
@@ -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:
|
|
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
|
|
@@ -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;
|
package/lib/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js
CHANGED
|
@@ -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:
|
|
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
|
|
@@ -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;
|