From 7f88a0722e49799473c09b46ae2fca01c6001c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Tue, 28 Nov 2023 15:23:35 +0300 Subject: [PATCH] #5429 for Panel --- components/doc/panel/accessibilitydoc.js | 97 ++++++++++++------------ components/lib/panel/Panel.js | 5 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/components/doc/panel/accessibilitydoc.js b/components/doc/panel/accessibilitydoc.js index b372044cdf..2744fb3552 100644 --- a/components/doc/panel/accessibilitydoc.js +++ b/components/doc/panel/accessibilitydoc.js @@ -1,57 +1,54 @@ -import { DevelopmentSection } from '@/components/doc/common/developmentsection'; import { DocSectionText } from '@/components/doc/common/docsectiontext'; export function AccessibilityDoc() { return ( - - -

Screen Reader

-

- Toggleable panels use a content toggle button at the header that has aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read the button defaults to - the value of the header property and can be customized by defining an aria-label or aria-labelledby via the toggleButtonProps property. -

-

- The content uses region, defines an id that matches the aria-controls of the content toggle button and aria-labelledby referring to the id of the header. -

+ +

Screen Reader

+

+ Toggleable panels use a content toggle button at the header that has aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read the button defaults to the + value of the header property and can be customized by defining an aria-label or aria-labelledby via the toggleButtonProps property. +

+

+ The content uses region, defines an id that matches the aria-controls of the content toggle button and aria-labelledby referring to the id of the header. +

-

Content Toggle Button Keyboard Support

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
KeyFunction
- tab - Moves focus to the next the focusable element in the page tab sequence.
- shift + tab - Moves focus to the previous the focusable element in the page tab sequence.
- enter - Toggles the visibility of the content.
- space - Toggles the visibility of the content.
-
-
-
+

Content Toggle Button Keyboard Support

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
KeyFunction
+ tab + Moves focus to the next the focusable element in the page tab sequence.
+ shift + tab + Moves focus to the previous the focusable element in the page tab sequence.
+ enter + Toggles the visibility of the content.
+ space + Toggles the visibility of the content.
+
+ ); } diff --git a/components/lib/panel/Panel.js b/components/lib/panel/Panel.js index 3d204e013d..8e70036ec1 100644 --- a/components/lib/panel/Panel.js +++ b/components/lib/panel/Panel.js @@ -90,7 +90,9 @@ export const Panel = React.forwardRef((inProps, ref) => { id: buttonId, 'aria-controls': contentId, 'aria-expanded': !collapsed, - role: 'tab' + type: 'button', + role: 'button', + 'aria-label': props.toggleButtonProps && props.toggleButtonProps['aria-label'] ? props.toggleButtonProps['aria-label'] : props.header }, ptm('toggler') ); @@ -161,6 +163,7 @@ export const Panel = React.forwardRef((inProps, ref) => { iconsElement, togglerElement, element: content, + id: idState + '_header', props, collapsed };