Skip to content

Commit

Permalink
Fix missing 'id' and 'tabIndex' support for TextInput
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed Nov 16, 2022
1 parent dfeb49c commit 1003b1c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,9 @@ function InternalTextInput(props: Props): React.Node {
'aria-expanded': ariaExpanded,
'aria-selected': ariaSelected,
accessibilityState,
id,
tabIndex,
...otherProps
} = props;

const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
Expand Down Expand Up @@ -1436,15 +1439,16 @@ function InternalTextInput(props: Props): React.Node {
textInput = (
<RCTTextInputView
ref={_setNativeRef}
{...props}
{...otherProps}
{...eventHandlers}
accessibilityState={_accessibilityState}
accessible={accessible}
submitBehavior={submitBehavior}
caretHidden={caretHidden}
dataDetectorTypes={props.dataDetectorTypes}
focusable={focusable}
focusable={tabIndex !== undefined ? !tabIndex : focusable}
mostRecentEventCount={mostRecentEventCount}
nativeID={id ?? props.nativeID}
onBlur={_onBlur}
onKeyPressSync={props.unstable_onKeyPressSync}
onChange={_onChange}
Expand Down Expand Up @@ -1485,7 +1489,7 @@ function InternalTextInput(props: Props): React.Node {
* fixed */
<AndroidTextInput
ref={_setNativeRef}
{...props}
{...otherProps}
{...eventHandlers}
accessibilityState={_accessibilityState}
accessibilityLabelledBy={_accessibilityLabelledBy}
Expand All @@ -1495,8 +1499,9 @@ function InternalTextInput(props: Props): React.Node {
caretHidden={caretHidden}
children={children}
disableFullscreenUI={props.disableFullscreenUI}
focusable={focusable}
focusable={tabIndex !== undefined ? !tabIndex : focusable}
mostRecentEventCount={mostRecentEventCount}
nativeID={id ?? props.nativeID}
numberOfLines={props.rows ?? props.numberOfLines}
onBlur={_onBlur}
onChange={_onChange}
Expand Down

0 comments on commit 1003b1c

Please sign in to comment.