Skip to content

Commit 7019832

Browse files
denscollotonyanziano
authored andcommitted
Fixed VoiceOver narration issue with Split Button (#2012)
* Add auxiliary label for splitButton * Fix imports order * Update changelog * Rename property and change default value * Remove extra space in CHANGELOG
1 parent 3ecf25f commit 7019832

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- [2002](https://github.com/microsoft/BotFramework-Emulator/pull/2002)
2525
- [2009](https://github.com/microsoft/BotFramework-Emulator/pull/2009)
2626
- [2010](https://github.com/microsoft/BotFramework-Emulator/pull/2010)
27+
- [2012](https://github.com/microsoft/BotFramework-Emulator/pull/2012)
2728

2829
- [main] Increased ngrok spawn timeout to 15 seconds to be more forgiving to slower networks in PR [1998](https://github.com/microsoft/BotFramework-Emulator/pull/1998)
2930

packages/app/client/src/ui/editor/emulator/emulator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848

4949
import { Document, SplitterSize } from '../../../state/reducers/editor';
5050
import { debounce } from '../../../utils';
51+
import { isMac } from '../../../../../main/src/utils/platform';
5152

5253
import { ChatPanelContainer } from './chatPanel';
5354
import LogPanel from './logPanel/logPanel';
@@ -304,6 +305,7 @@ export class Emulator extends React.Component<EmulatorProps, {}> {
304305
options={[NewUserId, SameUserId]}
305306
onClick={this.onStartOverClick}
306307
buttonRef={this.setRestartButtonRef}
308+
submenuLabel={isMac() ? 'Restart conversation sub menu' : ''}
307309
/>
308310
<button
309311
role={'menuitem'}

packages/sdk/ui-react/src/widget/splitButton/splitButton.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface SplitButtonProps {
4646
options?: string[];
4747
buttonRef?: (ref: HTMLButtonElement) => void;
4848
selected?: number;
49+
submenuLabel?: string;
4950
}
5051

5152
export interface SplitButtonState {
@@ -66,7 +67,14 @@ export class SplitButton extends React.Component<SplitButtonProps, SplitButtonSt
6667
}
6768

6869
public render(): JSX.Element {
69-
const { buttonClass = '', defaultLabel = '', disabled = false, id = '', options = [] } = this.props;
70+
const {
71+
buttonClass = '',
72+
defaultLabel = '',
73+
disabled = false,
74+
id = '',
75+
options = [],
76+
submenuLabel = '',
77+
} = this.props;
7078
const { expanded, selected } = this.state;
7179
const {
7280
caretRef,
@@ -95,7 +103,7 @@ export class SplitButton extends React.Component<SplitButtonProps, SplitButtonSt
95103
</button>
96104
<div className={styles.separator} aria-hidden={'true'} />
97105
<button
98-
aria-label={defaultLabel}
106+
aria-label={submenuLabel || defaultLabel}
99107
className={styles.caretButton + expandedClass}
100108
ref={setCaretRef}
101109
onClick={onClickCaret}

0 commit comments

Comments
 (0)