Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 24b070b

Browse files
OEvgenyEugene Olonova-b-r-o-w-n
authored
fix: a11y keyboard interactions for configure and publish screens (#8844)
* Fix losing keyboard focus after modal gets closed * Prevent navigation to publishing profile tab on dropdown focus Co-authored-by: Eugene Olonov <[email protected]> Co-authored-by: Andy Brown <[email protected]>
1 parent fa797ee commit 24b070b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Composer/packages/client/src/pages/botProject/RootBotExternalService.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ export const RootBotExternalService: React.FC<RootBotExternalServiceProps> = (pr
411411
)}
412412
</div>
413413
<PrimaryButton
414-
disabled={displayManageLuis || displayManageQNA}
415414
styles={{ root: { width: '250px', marginTop: '15px' } }}
416415
text={formatMessage('Set up Language Understanding')}
417416
onClick={() => {
@@ -480,7 +479,6 @@ export const RootBotExternalService: React.FC<RootBotExternalServiceProps> = (pr
480479
/>
481480
</div>
482481
<PrimaryButton
483-
disabled={displayManageLuis || displayManageQNA}
484482
styles={{ root: { width: '250px', marginTop: '15px' } }}
485483
text={formatMessage('Set up QnA Maker')}
486484
onClick={() => {

Composer/packages/client/src/pages/publish/BotStatusList.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,18 @@ export const BotStatusList: React.FC<BotStatusListProps> = ({
125125
}
126126
};
127127

128-
const handleChangePublishTarget = (item: BotStatus, option?: IDropdownOption): void => {
128+
const isDropdownFocusEvent = (event: React.FormEvent<HTMLDivElement>) => event.type === 'focus';
129+
130+
const handleChangePublishTarget = (
131+
event: React.FormEvent<HTMLDivElement>,
132+
item: BotStatus,
133+
option?: IDropdownOption
134+
): void => {
129135
if (option) {
130136
if (option.key === 'manageProfiles') {
137+
// Focus events trigger onChange when no option selected
138+
// This prevents navigation on focus events
139+
if (isDropdownFocusEvent(event)) return;
131140
onManagePublishProfile(item.id);
132141
} else {
133142
onChangePublishTarget(option.text, item);
@@ -215,14 +224,14 @@ export const BotStatusList: React.FC<BotStatusListProps> = ({
215224
onRender: (item: BotStatus) => {
216225
return (
217226
<Dropdown
218-
defaultSelectedKey={item.publishTarget}
219227
options={getPublishTargetOptions(item)}
220228
placeholder={formatMessage('Select a publish target')}
229+
selectedKey={item.publishTarget}
221230
styles={{
222231
root: { width: '100%' },
223232
dropdownItems: { selectors: { '.ms-Button-flexContainer': { width: '100%' } } },
224233
}}
225-
onChange={(_, option?: IDropdownOption) => handleChangePublishTarget(item, option)}
234+
onChange={(event, option?: IDropdownOption) => handleChangePublishTarget(event, item, option)}
226235
onRenderOption={renderDropdownOption}
227236
/>
228237
);

0 commit comments

Comments
 (0)