Skip to content

Commit 9c77568

Browse files
Merge branch 'master' into FE-7534
2 parents 40c4978 + 81869f8 commit 9c77568

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [158.16.1](https://github.com/Sage/carbon/compare/v158.16.0...v158.16.1) (2026-01-14)
2+
3+
### Bug Fixes
4+
5+
* **text-editor:** assistive technologies announce read only when appropriate ([21b2575](https://github.com/Sage/carbon/commit/21b25758bcd3a0d64502e26e978ef2851a897329)), closes [#7693](https://github.com/Sage/carbon/issues/7693)
6+
17
## [158.16.0](https://github.com/Sage/carbon/compare/v158.15.2...v158.16.0) (2026-01-12)
28

39
### Features

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "carbon-react",
3-
"version": "158.16.0",
3+
"version": "158.16.1",
44
"description": "A library of reusable React components for easily building user interfaces.",
55
"files": [
66
"lib",

src/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ const ReadOnlyEditor = ({
8686
/** The following are automatically added by Lexical but violate WCAG 4.1.2 Name, Role, Value and so have been overriden */
8787
aria-autocomplete={undefined}
8888
aria-readonly={undefined}
89+
/**
90+
* We don't have access to the underlying element, setting a role here means the element will remain a div
91+
* but assistive technologies will recognise the element as an article. Which is more suitable for an element which
92+
* is meant to be read-only and non interactive/editable.
93+
*/
94+
role="article"
8995
/>
9096
}
9197
ErrorBoundary={LexicalErrorBoundary}

src/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ test("should render read-only editor with plain text", () => {
99
expect(screen.getByText("Hello, World!")).toBeInTheDocument();
1010
});
1111

12+
test("should render read-only editor as an article", () => {
13+
render(<ReadOnlyEditor initialValue="Hello, World!" />);
14+
15+
const readOnlyEditor = screen.getByRole("article");
16+
17+
expect(readOnlyEditor).toBeVisible();
18+
expect(readOnlyEditor).toHaveTextContent("Hello, World!");
19+
});
20+
1221
test("should wrap plain-text links with anchors in the editor", () => {
1322
const sampleHTML = `<pre spellcheck="false"><span style="font-weight: 400; font-size: 14px; line-height: 21px;">Hello, World! </span><a href="www.bbc.co.uk" rel="noreferrer"><span style="white-space: pre-wrap;">www.bbc.co.uk</span></a><span style="white-space: pre-wrap;"> </span><a href="http://www.google.com"><span style="white-space: pre-wrap;">http://www.google.com</span></a><span style="white-space: pre-wrap;"> </span><a href="https://www.sage.com"><span style="white-space: pre-wrap;">https://www.sage.com</span></a></pre>`;
1423
render(<ReadOnlyEditor initialValue={sampleHTML} />);

0 commit comments

Comments
 (0)