{/* https://github.com/carbon-design-system/carbon/pull/6008#issuecomment-675738670 */}
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
diff --git a/packages/react/src/components/TreeView/TreeView-test.js b/packages/react/src/components/TreeView/TreeView-test.js
index 9ab5e46aad14..1f246c1c4289 100644
--- a/packages/react/src/components/TreeView/TreeView-test.js
+++ b/packages/react/src/components/TreeView/TreeView-test.js
@@ -228,4 +228,72 @@ describe('TreeView', () => {
);
});
});
+
+ describe('keyboard navigation', () => {
+ it('should focus on the first child node when right arrow is pressed on an expanded parent node', async () => {
+ const user = userEvent.setup();
+
+ render(
+
+
+
+
+
+
+ );
+
+ const parentNode = screen.getByTestId('parent-node');
+ const childNode1 = screen.getByTestId('child-node-1');
+
+ // Focus on the parent node
+ parentNode.focus();
+ expect(parentNode).toHaveFocus();
+
+ // Press the right arrow key
+ await user.keyboard('[ArrowRight]');
+
+ // Check if the first child node is now focused
+ expect(childNode1).toHaveFocus();
+ });
+
+ it('should expand a collapsed parent node when right arrow is pressed', async () => {
+ const user = userEvent.setup();
+
+ render(
+
+
+
+
+
+ );
+
+ const parentNode = screen.getByTestId('parent-node');
+
+ // Initially, the parent node should not be expanded
+ expect(parentNode).not.toHaveAttribute('aria-expanded', 'true');
+
+ // Focus on the parent node
+ parentNode.focus();
+ expect(parentNode).toHaveFocus();
+
+ // Press the right arrow key
+ await user.keyboard('[ArrowRight]');
+
+ // The parent node should now be expanded
+ expect(parentNode).toHaveAttribute('aria-expanded', 'true');
+
+ // Now that the parent is expanded, we can check for the child node
+ const childNode = screen.getByTestId('child-node');
+ expect(childNode).toBeInTheDocument();
+
+ // The parent node should still have focus
+ expect(parentNode).toHaveFocus();
+ });
+ });
});
From 813e69e3d0f70248d41b8c4f48ff22e79aa6647f Mon Sep 17 00:00:00 2001
From: Guilherme Datilio Ribeiro
Date: Wed, 4 Sep 2024 16:54:58 -0300
Subject: [PATCH 08/10] fix: fixed labels (#17315)
---
.../src/components/Toggle/Toggle.stories.js | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/packages/react/src/components/Toggle/Toggle.stories.js b/packages/react/src/components/Toggle/Toggle.stories.js
index 6ed8692fdfd1..f1bc3b3bcbb0 100644
--- a/packages/react/src/components/Toggle/Toggle.stories.js
+++ b/packages/react/src/components/Toggle/Toggle.stories.js
@@ -17,7 +17,7 @@ export default {
export const Default = () => (
(
export const SmallToggle = () => (
(
);
export const Playground = (args) => (
-
+
);
Playground.argTypes = {
@@ -85,9 +92,9 @@ Playground.argTypes = {
export const WithAccessibleLabels = () => (
-
+
-
+
From 6dd3d88812f65311335e5b3933b74f11ef744a23 Mon Sep 17 00:00:00 2001
From: Taylor Jones
Date: Wed, 4 Sep 2024 15:19:03 -0500
Subject: [PATCH 09/10] fix(storybook): use plex in manager ui even when not
installed (#17308)
Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
---
packages/react/.storybook/manager-head.html | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/packages/react/.storybook/manager-head.html b/packages/react/.storybook/manager-head.html
index fbf0af6d7d50..46fe3d3be92d 100644
--- a/packages/react/.storybook/manager-head.html
+++ b/packages/react/.storybook/manager-head.html
@@ -74,6 +74,16 @@
type="text/javascript"
async="async">
+
+
+