diff --git a/packages/core/accessibility/accessibility-properties.ts b/packages/core/accessibility/accessibility-properties.ts index 9c77654198..96d99df747 100644 --- a/packages/core/accessibility/accessibility-properties.ts +++ b/packages/core/accessibility/accessibility-properties.ts @@ -26,7 +26,6 @@ function makePropertyEnumConverter(enumValues) { export const accessibilityEnabledProperty = new CssProperty({ name: 'accessible', - defaultValue: true, cssName: 'a11y-enabled', valueConverter: booleanConverter, }); diff --git a/packages/core/ui/core/view/index.android.ts b/packages/core/ui/core/view/index.android.ts index 2ac9ac685b..621161b23c 100644 --- a/packages/core/ui/core/view/index.android.ts +++ b/packages/core/ui/core/view/index.android.ts @@ -832,9 +832,7 @@ export class View extends ViewCommon { [accessibilityEnabledProperty.setNative](value: boolean): void { this.nativeViewProtected.setFocusable(!!value); - if (value) { - updateAccessibilityProperties(this); - } + updateAccessibilityProperties(this); } [accessibilityIdentifierProperty.setNative](value: string): void { diff --git a/packages/core/ui/core/view/index.d.ts b/packages/core/ui/core/view/index.d.ts index d21a4aef13..3622219cf7 100644 --- a/packages/core/ui/core/view/index.d.ts +++ b/packages/core/ui/core/view/index.d.ts @@ -228,6 +228,11 @@ export abstract class View extends ViewCommon { */ color: Color; + /** + * If `true` the element is an accessibility element and all the children will be treated as a single selectable component. + */ + accessible: boolean; + /** * Hide the view and its children from the a11y service */ diff --git a/packages/core/ui/core/view/index.ios.ts b/packages/core/ui/core/view/index.ios.ts index b2594468a8..3465ce4f8c 100644 --- a/packages/core/ui/core/view/index.ios.ts +++ b/packages/core/ui/core/view/index.ios.ts @@ -683,9 +683,8 @@ export class View extends ViewCommon implements ViewDefinition { [accessibilityEnabledProperty.setNative](value: boolean): void { this.nativeViewProtected.isAccessibilityElement = !!value; - if (value) { - updateAccessibilityProperties(this); - } + + updateAccessibilityProperties(this); } [accessibilityIdentifierProperty.getDefault](): string { diff --git a/packages/core/ui/core/view/view-common.ts b/packages/core/ui/core/view/view-common.ts index d05e8107ed..d23ae92bc3 100644 --- a/packages/core/ui/core/view/view-common.ts +++ b/packages/core/ui/core/view/view-common.ts @@ -194,9 +194,8 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { } } super.onLoaded(); - if (this.accessible) { - setupAccessibleView(this); - } + + setupAccessibleView(this); } public _closeAllModalViewsInternal(): boolean { diff --git a/packages/core/ui/layouts/layout-base-common.ts b/packages/core/ui/layouts/layout-base-common.ts index a07964a02d..95e10c70ff 100644 --- a/packages/core/ui/layouts/layout-base-common.ts +++ b/packages/core/ui/layouts/layout-base-common.ts @@ -3,22 +3,10 @@ import { CoreTypes } from '../../core-types'; import { View, CustomLayoutView, AddChildFromBuilder } from '../core/view'; import { booleanConverter, getViewById } from '../core/view-base'; import { Property } from '../core/properties'; -import { accessibilityEnabledProperty } from '../../accessibility/accessibility-properties'; export class LayoutBaseCommon extends CustomLayoutView implements LayoutBaseDefinition, AddChildFromBuilder { private _subViews = new Array(); - constructor() { - super(); - - /** - * mark accessible as false without triggering property change - * equivalent to changing the default - * TODO: Remove this when we have a more flexible API for declaring default property values per type of view - */ - this.style[accessibilityEnabledProperty.key] = false; - } - public _addChildFromBuilder(name: string, value: any) { if (value instanceof View) { this.addChild(value);