Skip to content

Commit 2805c1e

Browse files
authored
[Fabric] Implement aria-level, aria-posinset, aria-setsize in TextInput (#14732)
1 parent 9c55fc4 commit 2805c1e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "[Fabric] Implement aria-level, aria-posinset, aria-setsize in TextInput",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/playground/Samples/textinput.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export default class Bootstrap extends React.Component<{}, any> {
7575
style={styles.input}
7676
placeholder={'MultiLine'}
7777
multiline={true}
78+
aria-level={1}
79+
aria-posinset={1}
80+
aria-setsize={30}
7881
/>
7982
<TextInput
8083
style={styles.input}

vnext/src-win/Libraries/Components/TextInput/TextInput.windows.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,12 @@ function InternalTextInput(props: TextInputProps): React.Node {
13701370
'aria-readonly': ariaReadOnly, // Windows
13711371
'aria-multiselectable': ariaMultiselectable, // Windows
13721372
'aria-required': ariaRequired, // Windows
1373+
'aria-level': ariaLevel, // Windows
1374+
'aria-posinset': ariaPosinset, // Windows
1375+
'aria-setsize': ariaSetsize, // Windows
1376+
accessibilityLevel, // Windows
1377+
accessibilityPosInSet, // Windows
1378+
accessibilitySetSize, // Windows
13731379
accessibilityState,
13741380
id,
13751381
tabIndex,
@@ -1693,6 +1699,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
16931699
props.onKeyUpCapture && props.onKeyUpCapture(event);
16941700
};
16951701

1702+
const _accessibilityLevel = ariaLevel ?? accessibilityLevel; // Windows
1703+
const _accessibilityPosInSet = ariaPosinset ?? accessibilityPosInSet; // Windows
1704+
const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; // Windows
1705+
16961706
let _accessibilityState;
16971707
if (
16981708
accessibilityState != null ||
@@ -1877,6 +1887,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
18771887
mostRecentEventCount={mostRecentEventCount}
18781888
onBlur={_onBlur}
18791889
onChange={_onChange}
1890+
accessibilityState={_accessibilityState}
1891+
accessibilityLevel={_accessibilityLevel}
1892+
accessibilityPosInSet={_accessibilityPosInSet}
1893+
accessibilitySetSize={_accessibilitySetSize}
18801894
/* $FlowFixMe[incompatible-type] the types for WindowsTextInput
18811895
* don't match up exactly with the props for TextInput. This will need
18821896
* to get fixed */

0 commit comments

Comments
 (0)