mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 10:46:19 +00:00
+1
@@ -35,6 +35,7 @@ exports[`components/Button prop "disabled" 1`] = `
|
|||||||
class="css-view-1dbjc4n r-backgroundColor-11mpjr4 r-borderRadius-1jkafct r-transitionProperty-1i6wzkk r-userSelect-lrvibr"
|
class="css-view-1dbjc4n r-backgroundColor-11mpjr4 r-borderRadius-1jkafct r-transitionProperty-1i6wzkk r-userSelect-lrvibr"
|
||||||
role="button"
|
role="button"
|
||||||
style="transition-duration: 0s;"
|
style="transition-duration: 0s;"
|
||||||
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="css-text-901oao r-color-c68hjy r-fontWeight-majxgm r-padding-edyy15 r-textAlign-q4m81j r-textTransform-tsynxw"
|
class="css-text-901oao r-color-c68hjy r-fontWeight-majxgm r-padding-edyy15 r-textAlign-q4m81j r-textTransform-tsynxw"
|
||||||
|
|||||||
+11
-10
@@ -18,16 +18,6 @@ exports[`components/Image prop "accessibilityLabel" 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`components/Image prop "accessible" 1`] = `
|
|
||||||
<div
|
|
||||||
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="css-view-1dbjc4n r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-backgroundSize-4gszlv r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`components/Image prop "blurRadius" 1`] = `
|
exports[`components/Image prop "blurRadius" 1`] = `
|
||||||
<div
|
<div
|
||||||
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
||||||
@@ -132,6 +122,17 @@ exports[`components/Image prop "draggable" 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`components/Image prop "focusable" 1`] = `
|
||||||
|
<div
|
||||||
|
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="css-view-1dbjc4n r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-backgroundSize-4gszlv r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`components/Image prop "nativeID" 1`] = `
|
exports[`components/Image prop "nativeID" 1`] = `
|
||||||
<div
|
<div
|
||||||
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ describe('components/Image', () => {
|
|||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('prop "accessible"', () => {
|
|
||||||
const { container } = render(<Image accessible={false} />);
|
|
||||||
expect(container.firstChild).toMatchSnapshot();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('prop "blurRadius"', () => {
|
test('prop "blurRadius"', () => {
|
||||||
const defaultSource = { uri: 'https://google.com/favicon.ico' };
|
const defaultSource = { uri: 'https://google.com/favicon.ico' };
|
||||||
const { container } = render(<Image blurRadius={5} defaultSource={defaultSource} />);
|
const { container } = render(<Image blurRadius={5} defaultSource={defaultSource} />);
|
||||||
@@ -83,6 +78,11 @@ describe('components/Image', () => {
|
|||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('prop "focusable"', () => {
|
||||||
|
const { container } = render(<Image focusable={true} />);
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
test('prop "nativeID"', () => {
|
test('prop "nativeID"', () => {
|
||||||
const { container } = render(<Image nativeID="nativeID" />);
|
const { container } = render(<Image nativeID="nativeID" />);
|
||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|||||||
+1
@@ -132,6 +132,7 @@ exports[`components/Pressable prop "disabled" 1`] = `
|
|||||||
<div
|
<div
|
||||||
aria-disabled="true"
|
aria-disabled="true"
|
||||||
class="css-view-1dbjc4n"
|
class="css-view-1dbjc4n"
|
||||||
|
tabindex="-1"
|
||||||
/>
|
/>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -515,7 +515,7 @@ describe('exports/createElement', () => {
|
|||||||
const { container: isFalseFocusableRole } = render(
|
const { container: isFalseFocusableRole } = render(
|
||||||
createElement('div', { accessibilityRole: 'button', focusable: false })
|
createElement('div', { accessibilityRole: 'button', focusable: false })
|
||||||
);
|
);
|
||||||
expect(getAttribute(isFalseFocusableRole, 'tabindex')).toBeNull();
|
expect(getAttribute(isFalseFocusableRole, 'tabindex')).toBe('-1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+6
-4
@@ -27,7 +27,7 @@ describe('modules/createDOMProps', () => {
|
|||||||
|
|
||||||
test('when "focusable" is false', () => {
|
test('when "focusable" is false', () => {
|
||||||
expect(createProps({ accessibilityRole, focusable: false })).toEqual(
|
expect(createProps({ accessibilityRole, focusable: false })).toEqual(
|
||||||
expect.not.objectContaining({ tabIndex: '-1' })
|
expect.objectContaining({ tabIndex: '-1' })
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@ describe('modules/createDOMProps', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('when "focusable" is false', () => {
|
test('when "focusable" is false', () => {
|
||||||
expect(createProps({ accessibilityRole, focusable: false })).not.toEqual(
|
expect(createProps({ accessibilityRole, focusable: false })).toEqual(
|
||||||
expect.objectContaining({ tabIndex: '0' })
|
expect.objectContaining({ tabIndex: '-1' })
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -92,7 +92,9 @@ describe('modules/createDOMProps', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('when "focusable" is false', () => {
|
test('when "focusable" is false', () => {
|
||||||
expect(createProps({ focusable: false })).toEqual({});
|
expect(createProps({ focusable: false })).toEqual(
|
||||||
|
expect.objectContaining({ tabIndex: '-1' })
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -346,6 +346,9 @@ const createDOMProps = (elementType, props) => {
|
|||||||
// FOCUS
|
// FOCUS
|
||||||
// "focusable" indicates that an element may be a keyboard tab-stop.
|
// "focusable" indicates that an element may be a keyboard tab-stop.
|
||||||
const _focusable = focusable != null ? focusable : accessible;
|
const _focusable = focusable != null ? focusable : accessible;
|
||||||
|
if (_focusable === false) {
|
||||||
|
domProps.tabIndex = '-1';
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
// These native elements are focusable by default
|
// These native elements are focusable by default
|
||||||
elementType === 'a' ||
|
elementType === 'a' ||
|
||||||
|
|||||||
Reference in New Issue
Block a user