screenreader content changed to announce the entire alert

This commit is contained in:
Sampath 2023-05-31 14:41:19 +05:30
parent 85bd63f1a4
commit e267b5c1cc
2 changed files with 6 additions and 8 deletions

View File

@ -32,14 +32,8 @@ export const PanelInfoErrorComponent: React.FunctionComponent<PanelInfoErrorProp
return (
<Stack className="panelInfoErrorContainer" horizontal verticalAlign="center">
{icon}
<span className="panelWarningErrorDetailsLinkContainer">
<Text
role="alert"
aria-live="assertive"
aria-label={message}
className="panelWarningErrorMessage"
variant="small"
>
<span className="panelWarningErrorDetailsLinkContainer" role="alert" aria-live="assertive">
<Text aria-label={message} className="panelWarningErrorMessage" variant="small">
{message}
{link && linkText && (
<Link target="_blank" href={link}>

View File

@ -1,3 +1,4 @@
import { useNotificationConsole } from "hooks/useNotificationConsole";
import React, { FunctionComponent, ReactNode } from "react";
import { PanelFooterComponent } from "../PanelFooterComponent";
import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent";
@ -22,9 +23,12 @@ export const RightPaneForm: FunctionComponent<RightPaneFormProps> = ({
isSubmitButtonDisabled = false,
children,
}: RightPaneFormProps) => {
const expandConsole = useNotificationConsole((state) => state.expandConsole);
const handleOnSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
console.log("right pane form clicked");
onSubmit();
expandConsole();
};
return (