File tree Expand file tree Collapse file tree
src/components/collapsible_nav_beta Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ exports[`EuiCollapsibleNavBeta renders initialIsCollapsed 1`] = `
8888 data-focus-lock-disabled = " disabled"
8989 >
9090 <nav
91+ aria-label = " Site menu"
9192 class = " euiFlyout euiCollapsibleNav euiCollapsibleNavBeta emotion-euiFlyout-none-noMaxWidth-push-left-left-euiCollapsibleNavBeta-left-isPush-isPushCollapsed"
9293 data-test-subj = " nav"
9394 id = " generated-id_euiCollapsibleNav"
@@ -177,7 +178,7 @@ exports[`EuiCollapsibleNavBeta responsive behavior makes the overlay flyout full
177178 >
178179 <nav
179180 aria-describedby = " generated-id"
180- aria-label = " Site navigation "
181+ aria-label = " Site menu "
181182 class = " euiFlyout euiCollapsibleNav euiCollapsibleNavBeta emotion-euiFlyout-none-noMaxWidth-overlay-left-euiCollapsibleNavBeta-left-isOverlayFullWidth"
182183 data-autofocus = " true"
183184 id = " generated-id_euiCollapsibleNav"
Original file line number Diff line number Diff line change @@ -60,6 +60,16 @@ export type EuiCollapsibleNavBetaProps = CommonProps &
6060 * take up the full width of the page.
6161 */
6262 width ?: number ;
63+ /**
64+ * Overlay flyouts are considered dialogs, and dialogs must have a label.
65+ * By default, a label of `Site menu` will be applied.
66+ *
67+ * If your usage of this component is not actually for site-wide navigation,
68+ * please set your own `aria-label` or `aria-labelledby`.
69+ *
70+ * @default 'Site menu'
71+ */
72+ 'aria-label' ?: string ;
6373 } ;
6474
6575export const EuiCollapsibleNavBeta : FunctionComponent <
@@ -157,9 +167,9 @@ export const EuiCollapsibleNavBeta: FunctionComponent<
157167 conditionalId : id ,
158168 suffix : 'euiCollapsibleNav' ,
159169 } ) ;
160- const dialogAriaLabel = useEuiI18n (
170+ const defaultAriaLabel = useEuiI18n (
161171 'euiCollapsibleNavBeta.ariaLabel' ,
162- 'Site navigation '
172+ 'Site menu '
163173 ) ;
164174
165175 const buttonRef = useRef < HTMLDivElement | null > ( null ) ;
@@ -188,7 +198,7 @@ export const EuiCollapsibleNavBeta: FunctionComponent<
188198 // Wait for any fixed headers to be queried before rendering (prevents position jumping)
189199 const flyout = fixedHeadersCount !== false && (
190200 < EuiFlyout
191- aria-label = { isOverlay ? dialogAriaLabel : undefined } // Overlay flyouts are dialogs and need a label. Push flyouts are not dialogs.
201+ aria-label = { defaultAriaLabel }
192202 { ...rest } // EuiCollapsibleNav is significantly less permissive than EuiFlyout
193203 id = { flyoutID }
194204 css = { cssStyles }
You can’t perform that action at this time.
0 commit comments