Skip to content

Commit 346716a

Browse files
authored
fix: exclude svg root from aria tree (#9370)
1 parent 27fe764 commit 346716a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/flyout_base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import * as renderManagement from './render_management.js';
3333
import {ScrollbarPair} from './scrollbar_pair.js';
3434
import {SEPARATOR_TYPE} from './separator_flyout_inflater.js';
3535
import * as blocks from './serialization/blocks.js';
36+
import {aria} from './utils.js';
3637
import {Coordinate} from './utils/coordinate.js';
3738
import * as dom from './utils/dom.js';
3839
import * as idGenerator from './utils/idgenerator.js';
@@ -309,6 +310,9 @@ export abstract class Flyout
309310
'class': 'blocklyFlyout',
310311
});
311312
this.svgGroup_.style.display = 'none';
313+
// Ignore the svg root in the accessibility tree since is is not focusable.
314+
aria.setRole(this.svgGroup_, aria.Role.PRESENTATION);
315+
312316
this.svgBackground_ = dom.createSvgElement(
313317
Svg.PATH,
314318
{'class': 'blocklyFlyoutBackground'},

core/inject.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export function inject(
5555
dom.addClass(subContainer, 'blocklyRTL');
5656
}
5757

58+
// Ignore the subcontainer in aria since it is not focusable
59+
aria.setRole(subContainer, aria.Role.PRESENTATION);
60+
5861
containerElement!.appendChild(subContainer);
5962
const svg = createDom(subContainer, options);
6063

0 commit comments

Comments
 (0)