From cbed1b6d7cd1d9d71e95d5849200cb3fb18b81f0 Mon Sep 17 00:00:00 2001 From: Melloware Date: Thu, 3 Oct 2024 09:10:56 -0400 Subject: [PATCH] Fix #7301: Dialog fix aria close label (#7302) --- components/lib/dialog/Dialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index b98194ee21..61a225332e 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import PrimeReact, { PrimeReactContext, localeOption } from '../api/Api'; +import PrimeReact, { PrimeReactContext, ariaLabel } from '../api/Api'; import { useHandleStyle } from '../componentbase/ComponentBase'; import { CSSTransition } from '../csstransition/CSSTransition'; import FocusTrap from '../focustrap/FocusTrap'; @@ -430,7 +430,7 @@ export const Dialog = React.forwardRef((inProps, ref) => { const createCloseIcon = () => { if (props.closable) { - const ariaLabel = props.ariaCloseIconLabel || localeOption('close'); + const labelAria = props.ariaCloseIconLabel || ariaLabel('close'); const closeButtonIconProps = mergeProps( { @@ -448,7 +448,7 @@ export const Dialog = React.forwardRef((inProps, ref) => { ref: closeRef, type: 'button', className: cx('closeButton'), - 'aria-label': ariaLabel, + 'aria-label': labelAria, onClick: onClose, onKeyDown: (ev) => { if (ev.key !== 'Escape') {