mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(android): accessibilityIdentifier (#9432)
needs to be set on `nativeTextViewProtected` for text-base components fixes https://github.com/nativescript-community/ui-material-components/issues/304
This commit is contained in:
@@ -13,6 +13,8 @@ import { Span } from './span';
|
||||
import { CoreTypes } from '../../core-types';
|
||||
import { layout } from '../../utils';
|
||||
import { isString, isNullOrUndefined } from '../../utils/types';
|
||||
import { accessibilityIdentifierProperty } from '../../accessibility/accessibility-properties';
|
||||
import * as Utils from '../../utils';
|
||||
|
||||
export * from './text-base-common';
|
||||
|
||||
@@ -435,6 +437,16 @@ export class TextBase extends TextBaseCommon {
|
||||
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
|
||||
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
|
||||
}
|
||||
|
||||
[accessibilityIdentifierProperty.setNative](value: string): void {
|
||||
// we override the default setter to apply it on nativeTextViewProtected
|
||||
const id = Utils.ad.resources.getId(':id/nativescript_accessibility_id');
|
||||
|
||||
if (id) {
|
||||
this.nativeTextViewProtected.setTag(id, value);
|
||||
this.nativeTextViewProtected.setTag(value);
|
||||
}
|
||||
}
|
||||
|
||||
_setNativeText(reset = false): void {
|
||||
if (reset) {
|
||||
|
||||
Reference in New Issue
Block a user