fix: exclude svg root from aria tree (#9370)

This commit is contained in:
Maribeth Moffatt
2025-09-22 09:55:32 -07:00
committed by GitHub
parent 27fe764428
commit 346716a3a8
2 changed files with 7 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ import * as renderManagement from './render_management.js';
import {ScrollbarPair} from './scrollbar_pair.js';
import {SEPARATOR_TYPE} from './separator_flyout_inflater.js';
import * as blocks from './serialization/blocks.js';
import {aria} from './utils.js';
import {Coordinate} from './utils/coordinate.js';
import * as dom from './utils/dom.js';
import * as idGenerator from './utils/idgenerator.js';
@@ -309,6 +310,9 @@ export abstract class Flyout
'class': 'blocklyFlyout',
});
this.svgGroup_.style.display = 'none';
// Ignore the svg root in the accessibility tree since is is not focusable.
aria.setRole(this.svgGroup_, aria.Role.PRESENTATION);
this.svgBackground_ = dom.createSvgElement(
Svg.PATH,
{'class': 'blocklyFlyoutBackground'},

View File

@@ -55,6 +55,9 @@ export function inject(
dom.addClass(subContainer, 'blocklyRTL');
}
// Ignore the subcontainer in aria since it is not focusable
aria.setRole(subContainer, aria.Role.PRESENTATION);
containerElement!.appendChild(subContainer);
const svg = createDom(subContainer, options);