Skip to content

Commit

Permalink
Fix #7301: Dialog fix aria close label (#7302)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 3, 2024
1 parent 67390ea commit cbed1b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/dialog/Dialog.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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(
{
Expand All @@ -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') {
Expand Down

0 comments on commit cbed1b6

Please sign in to comment.