Is it possible to un-register elements?
banjahman opened this issue · comments
banjahman commented
I was wondering if there's the ability to un-register elements after they've been created? My canvas object will hide a button under certain situations and I'm still able to tab to the element after it's been hidden within the canvas.
banjahman commented
Nevermind, I did some digging in the source and found a way to accomplish what I wanted.
For anyone looking on how to do this, see the following code snippet.
const root = new createjs.Container();
AccessibilityModule.register( {
displayObject: root,
role: AccessibilityModule.ROLES.NONE
} );
const element = new createjs.Container();
AccessibilityModule.register( {
displayObject: element,
role: AccessibilityModule.ROLES.BUTTON,
parent: this.root
} );
// de-register the element
const r = root as any;
r.accessible.removeChild( element );