Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file designates code owners for the repository.
# All changes to any file must be reviewed by repository admins or authorized users.
# Replace "@nmahesh-cainc" with your admin team or individual usernames as needed.

* @nmahesh-cainc
36 changes: 24 additions & 12 deletions src/RoleObjects/CompositeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import AccessibilityObject from './AccessibilityObject';

export default class CompositeData extends AccessibilityObject {
/**
* Sets the currently active descendant of a composite widget
* Sets the currently active descendant of a composite widget.
* This method updates the `aria-activedescendant` property, which is used by assistive technologies
* to indicate which child element of a composite widget (such as a listbox, tree, or grid) is currently active.
* If a DisplayObject is provided, it must have accessibility information attached; otherwise, an error is thrown.
* Passing `undefined` will unset the active descendant, removing the association from the widget.
*
* @access public
* @param {createjs.DisplayObject} displayObject - DisplayObject that is the active
descendant of this one. undefined to unset the field.
*/
* @param {createjs.DisplayObject} displayObject - The DisplayObject to set as the active descendant. If undefined, the active descendant is unset.
*/
set active(displayObject) {
if (displayObject && !displayObject.accessible) {
throw new Error(
Expand All @@ -20,19 +24,27 @@ export default class CompositeData extends AccessibilityObject {
}

/**
* Retrieves which DisplayObject is the current active descendant
* @access public
* @returns {createjs.DisplayObject} DisplayObject that is the current active descendant
*/
/**
* Gets the current active descendant DisplayObject for this composite widget.
* This is the DisplayObject that has been set as active, typically representing the item
* that is currently focused or selected within the widget for accessibility purposes.
*
* @access public
* @returns {createjs.DisplayObject} The DisplayObject that is the current active descendant, or undefined if none is set.
*/
get active() {
return this._active;
}

/**
* Retrieves the DOM id for the tranlated DisplayObject that is the active descendant.
* @access public
* @returns {String} id for the translated DisplayObject that is the active descendant
*/
/**
* Gets the DOM id of the currently active descendant DisplayObject.
* This value is used to set the `aria-activedescendant` attribute on the composite widget's DOM node,
* allowing assistive technologies to track which child element is active.
*
* @access public
* @returns {String} The DOM id of the active descendant DisplayObject, or undefined if none is set.
*/
get activeId() {
return this._reactProps['aria-activedescendant'];
}
Expand Down