Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.yoga.YogaConstants;
Expand Down Expand Up @@ -92,7 +93,8 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setNativeId(view, (String) value);
break;
case ViewProps.ACCESSIBILITY_LABELLED_BY:
mViewManager.setAccessibilityLabelledBy(view, (Dynamic) value);
Dynamic dynamicFromObject = new DynamicFromObject(value);
mViewManager.setAccessibilityLabelledBy(view, dynamicFromObject);
break;
case ViewProps.OPACITY:
mViewManager.setOpacity(view, value == null ? 1.0f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const {
StyleSheet,
Slider,
Platform,
Switch,
} = require('react-native');
import type {EventSubscription} from 'react-native/Libraries/vendor/emitter/EventEmitter';

Expand Down Expand Up @@ -212,6 +213,16 @@ class AccessibilityExample extends React.Component<{}> {
/>
</View>
</RNTesterBlock>
<RNTesterBlock title="Switch with accessibilityLabelledBy attribute">
<View>
<Text nativeID="formLabel4">Enable Notifications</Text>
<Switch
value={true}
accessibilityLabel="switch test1"
accessibilityLabelledBy="formLabel4"
/>
</View>
</RNTesterBlock>
</View>
);
}
Expand Down