-
Notifications
You must be signed in to change notification settings - Fork 19
0.3.1 to 1.0.0 Migration Guide
mnewcomb314 edited this page Mar 3, 2021
·
17 revisions
Work In Progress
The 1.0.0 release of CAM finished adding support for all ARIA roles. It also brought in some bug fixes and improvements, some of which are breaking changes that lead to multiple 1.0 pre-release versions of CAM before the 1.0.0 version was released. The purpose of this page is to document the breaking changes and how to address them in consuming projects. This page organizes the breaking changes by category, but all need to be addressed as part of the upgrade to the 1.0.0 version of CAM.
-
ROLES.OPTIONhas been split intoROLES.SINGLESELECTOPTIONandROLES.MULTISELECTOPTION. This was needed in order to support gettingROLES.SINGLESELECTLISTBOXworking visually consistent across browsers combined with CAM's one-to-one role to HTML tag mapping.- If an option is being added to a
ROLES.SINGLESELECTLISTBOX, then replaceROLES.OPTIONwithROLES.SINGLESELECTOPTION. - For options added to
ROLES.MULTISELECTLISTBOX, then replaceROLES.OPTIONwithROLES.MULTISELECTOPTION.
- If an option is being added to a
- If event listeners are bound after the
registerfunction is called, such as byaddEventListeneroron, then no changes are needed. - In the 0.x versions of CAM, the object passed to
registercould containonFocusandonKeyboardClickcallbacks for handling those particular events. In order to handle any event, those fields have been replaced by aneventsarray of objects that allows for binding an event handler for any event. The objects that make up this array have a field ofeventNamefor the string name of the particular event to bind for, and alistenerfield for specifying the event handler function. A sample of this way of binding event listeners can be seen in the test app at https://github.com/CurriculumAssociates/createjs-accessibility-tester/blob/290d6ab51c49381345b3b831c37c4f5c7ef48c89/src/widgets/ScrollBar.js#L29-L38.- For prior
onFocusandonKeyboardClickfields, for example:onFocus: _focusHandler, onKeyboardClick: _keyboardClickHandler, - Becomes:
events: [ { eventName: 'focus', listener: _focusHandler }, { eventName: 'keyboardClick', listener: _keyboardClickHandler } ],
- For prior
- The
hasPopUpgetter/setter of AccessibilityObject (the base class used to populate a registered DisplayObject's.accessiblefield) has been updated from a boolean to a string in order to allow for all the valid values that https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup specifies- For existing
trueorfalseparameter values, add quotes around the value or use another mechanism to convert it to a string - For existing undefined parameter values, no change needs to be made
- For existing
-
ROLES.ROWused to emit akeyboardClickevent when used inside aROLES.TREEGRIDto indicate that a row should expand or collapse. That has been replaced byROLES.TREEGRIDemittingcollapseRoworexpandRowevents. To handle this, thekeyboardClickevent listener on the row DisplayObject should be removed, and event listeners added to the tree grid DisplayObject for the collapse and expand row events.