Skip to content

Commit

Permalink
Port 'Updated ComboBox error to have role="alert" (#20013)' to 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffCox committed Sep 29, 2021
1 parent 8e804cd commit 00bc797
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,11 @@ export class ComboBox extends React.Component<IComboBoxProps, IComboBoxState> {
},
this._onRenderContainer,
)}
<div
role="region"
aria-live="polite"
aria-atomic="true"
id={errorMessageId}
className={hasErrorMessage ? this._classNames.errorMessage : ''}
>
{errorMessage !== undefined ? errorMessage : ''}
</div>
{hasErrorMessage && (
<div role="alert" id={errorMessageId} className={this._classNames.errorMessage}>
{errorMessage}
</div>
)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,6 @@ exports[`ComboBox Renders correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>
</div>
</div>
`;
Expand Down Expand Up @@ -735,14 +726,5 @@ exports[`ComboBox renders with a Keytip correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,6 @@ exports[`Component Examples renders ComboBox.Basic.Example.tsx correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
<button
className=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,5 @@ exports[`Component Examples renders ComboBox.Controlled.Example.tsx correctly 1`
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,5 @@ exports[`Component Examples renders ComboBox.ControlledMulti.Example.tsx correct
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,6 @@ exports[`Component Examples renders ComboBox.CustomStyled.Example.tsx correctly
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
<div
className="ms-ComboBox-container "
Expand Down Expand Up @@ -818,15 +809,6 @@ exports[`Component Examples renders ComboBox.CustomStyled.Example.tsx correctly
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox4-error"
role="region"
>

</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ exports[`Component Examples renders ComboBox.ErrorHandling.Example.tsx correctly
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=

{
Expand All @@ -341,7 +339,7 @@ exports[`Component Examples renders ComboBox.ErrorHandling.Example.tsx correctly
margin-top: 5px;
}
id="ComboBox0-error"
role="region"
role="alert"
>
Oh no! This ComboBox has an error!
</div>
Expand Down Expand Up @@ -734,15 +732,6 @@ exports[`Component Examples renders ComboBox.ErrorHandling.Example.tsx correctly
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox4-error"
role="region"
>

</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,6 @@ exports[`Component Examples renders ComboBox.Toggles.Example.tsx correctly 1`] =
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
<div
className=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,6 @@ exports[`Component Examples renders ComboBox.Virtualized.Example.tsx correctly 1
</span>
</button>
</div>
<div
aria-atomic="true"
aria-live="polite"
className=""
id="ComboBox0-error"
role="region"
>

</div>
</div>
</div>
`;

0 comments on commit 00bc797

Please sign in to comment.