mirror of
https://github.com/zoriya/react-native-web.git
synced 2025-12-06 06:36:13 +00:00
committed by
Nicolas Gallagher
parent
a8a0c1763b
commit
213b616b3c
@@ -23,7 +23,7 @@ function findSwitchThumb(container) {
|
||||
|
||||
describe('components/Switch', () => {
|
||||
test('accessibilityLabel is applied to native checkbox', () => {
|
||||
const { container } = render(<Switch accessibilityLabel="switch" />);
|
||||
const { container } = render(<Switch aria-label="switch" />);
|
||||
expect(findCheckbox(container).getAttribute('aria-label')).toBe('switch');
|
||||
});
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ const Switch: React.AbstractComponent<
|
||||
React.ElementRef<typeof View>
|
||||
> = React.forwardRef((props, forwardedRef) => {
|
||||
const {
|
||||
'aria-label': ariaLabel,
|
||||
accessibilityLabel,
|
||||
activeThumbColor,
|
||||
activeTrackColor,
|
||||
@@ -166,7 +167,7 @@ const Switch: React.AbstractComponent<
|
||||
];
|
||||
|
||||
const nativeControl = createElement('input', {
|
||||
accessibilityLabel,
|
||||
'aria-label': ariaLabel || accessibilityLabel,
|
||||
checked: value,
|
||||
disabled: disabled,
|
||||
onBlur: handleFocusState,
|
||||
|
||||
Reference in New Issue
Block a user