Skip to content

Commit 573cfb7

Browse files
authored
Remove aria-hidden attributes from focusables (#4659)
* Remove aria-hidden * Add entry
1 parent 619d180 commit 573cfb7

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2929
### Fixed
3030

3131
- Fixes [#4557](https://github.com/microsoft/BotFramework-WebChat/issues/4557). Flipper buttons in carousels and suggested actions is now renamed to "next/previous" from "left/right", by [@compulim](https://github.com/compulim), in PR [#4646](https://github.com/microsoft/BotFramework-WebChat/pull/4646)
32+
- Fixes [#4652](https://github.com/microsoft/BotFramework-WebChat/issues/4652). Keyboard help screen, activity focus traps, and chat history terminator should not be hidden behind `aria-hidden` because they are focusable, by [@compulim](https://github.com/compulim), in PR [#4659](https://github.com/microsoft/BotFramework-WebChat/pull/4659)
3233

3334
### Changed
3435

packages/component/src/BasicTranscript.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ const InternalTranscript = forwardRef<HTMLDivElement, InternalTranscriptProps>(
563563
<Fragment>
564564
<FocusRedirector redirectRef={rootElementRef} />
565565
<div
566-
aria-hidden={true}
567566
aria-labelledby={terminatorLabelId}
568567
className="webchat__basic-transcript__terminator"
569568
ref={terminatorRef}

packages/component/src/Transcript/KeyboardHelp.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ const KeyboardHelp: FC<{}> = () => {
8484

8585
return (
8686
<div
87-
// When the dialog is not shown, "aria-hidden" helps to prevent scan mode from able to scan the content of the dialog.
88-
aria-hidden={!shown}
8987
aria-labelledby={headerLabelId}
9088
className={classNames('webchat__keyboard-help', keyboardHelpStyleSet + '', {
9189
// Instead of using "hidden" attribute, we are using CSS to hide the dialog.

packages/component/src/Utils/FocusRedirector.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ const FocusRedirector: FC<FocusRedirectorProps> = ({ className, onFocus, redirec
2424
onFocus && onFocus();
2525
}, [onFocus, redirectRef]);
2626

27-
// For NVDA, we should set aria-hidden="true".
28-
// When using NVDA in browse mode, press up/down arrow keys will focus on this redirector.
29-
// This redirector is designed to capture TAB only and should not react on browse mode.
30-
// However, reacting with browse mode is currently okay. Just better to leave it alone.
31-
return <div aria-hidden="true" className={className} onFocus={handleFocus} tabIndex={0} />;
27+
// 2023-02-23: With NVDA 2022.1 and 2022.4, when in browse mode, up/down arrow keys no longer focus.
28+
// We no longer need to set aria-hidden="true" to hide it from browse mode.
29+
// 2021-09-21: For NVDA, we should set aria-hidden="true".
30+
// When using NVDA in browse mode, press up/down arrow keys will focus on this redirector.
31+
// This redirector is designed to capture TAB only and should not react on browse mode.
32+
// However, reacting with browse mode is currently okay. Just better to leave it alone.
33+
34+
return <div className={className} onFocus={handleFocus} tabIndex={0} />;
3235
};
3336

3437
FocusRedirector.defaultProps = {

0 commit comments

Comments
 (0)