Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ComboBox error to have role="alert" #20013

Merged
merged 4 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Updated error to be role alert",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Updated experiment snapshot that uses ComboBox",
"packageName": "@fluentui/react-experiments",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,6 @@ exports[`Component Examples renders ComboBox.Basic.Example.tsx correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox0-error"
role="region"
>

</div>
</div>
<button
className=
Expand Down Expand Up @@ -963,15 +954,6 @@ exports[`Component Examples renders ComboBox.Basic.Example.tsx correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox7-error"
role="region"
>

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

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

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

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

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

{
Expand All @@ -369,7 +367,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 @@ -770,15 +768,6 @@ exports[`Component Examples renders ComboBox.ErrorHandling.Example.tsx correctly
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox4-error"
role="region"
>

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

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

</div>
</div>
<div
className="ms-ComboBox-container "
Expand Down Expand Up @@ -848,15 +839,6 @@ exports[`Component Examples renders ComboBox.SelectAll.Example.tsx correctly 1`]
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox4-error"
role="region"
>

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

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

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

</div>
</div>
<div
className="ms-ComboBox-container "
Expand Down Expand Up @@ -829,15 +820,6 @@ exports[`Component Examples renders TimePicker.Example.tsx correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox4-error"
role="region"
>

</div>
</div>
<div
className="ms-ComboBox-container "
Expand Down Expand Up @@ -1237,15 +1219,6 @@ exports[`Component Examples renders TimePicker.Example.tsx correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox8-error"
role="region"
>

</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -1718,15 +1718,6 @@ exports[`Pagination render comboBox Pagination correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox6-error"
role="region"
>

</div>
</div>
<button
aria-label="next page"
Expand Down
14 changes: 5 additions & 9 deletions packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,11 @@ class ComboBoxInternal extends React.Component<IComboBoxInternalProps, IComboBox
},
this._onRenderContainer,
)}
<div
role="region"
aria-live="polite"
aria-atomic="true"
id={errorMessageId}
{...(hasErrorMessage ? { className: this._classNames.errorMessage } : { 'aria-hidden': true })}
>
{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 @@ -367,15 +367,6 @@ exports[`ComboBox Renders correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden={true}
aria-live="polite"
id="ComboBox0-error"
role="region"
>

</div>
</div>
`;

Expand Down Expand Up @@ -1136,13 +1127,6 @@ exports[`ComboBox Renders correctly when open 1`] = `
</div>
</div>
</span>
<div
aria-atomic="true"
aria-hidden="true"
aria-live="polite"
id="ComboBox0-error"
role="region"
/>
</div>
`;

Expand Down Expand Up @@ -2012,13 +1996,6 @@ exports[`ComboBox Renders correctly when opened in multi-select mode 1`] = `
</div>
</div>
</span>
<div
aria-atomic="true"
aria-hidden="true"
aria-live="polite"
id="ComboBox0-error"
role="region"
/>
</div>
`;

Expand Down Expand Up @@ -2364,12 +2341,5 @@ exports[`ComboBox renders with a Keytip correctly 1`] = `
</span>
</button>
</div>
<div
aria-atomic="true"
aria-hidden="true"
aria-live="polite"
id="ComboBox0-error"
role="region"
/>
</div>
`;