Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code field is disabled by default in iOS after enabling the new architecture #230

Closed
Shivangigupta01 opened this issue Oct 9, 2023 · 2 comments

Comments

@Shivangigupta01
Copy link

Details:
I am currently using react-native-confirmation-code-field to handle code fields in both Android and iOS. However, I have encountered an issue where the input fields are disabled in iOS after enabling the new architecture. This issue does not occur in Android. Can you please suggest a solution to fix this issue? This problem only arises when the new architecture is enabled.

Code snippet:
I have took the exact code snippet defined here in the example: https://github.com/retyui/react-native-confirmation-code-field/tree/master/examples/DemoCodeField/src/BasicExample

CodeVerification/index.tsx

 <CodeField
        ref={ref}
        {...props}
        value={value}
        onChangeText={setValue}
        cellCount={CELL_COUNT}
        rootStyle={styles.codeFieldRoot}
        keyboardType="number-pad"
        textContentType="oneTimeCode"
        renderCell={({index, symbol, isFocused}:any) => (
          <Text
            key={index}
            style={[styles.cell, isFocused && styles.focusCell]}
            onLayout={getCellOnLayoutHandler(index)}>
            {symbol || (isFocused ? <Cursor /> : null)}
          </Text>
        )}
      />

CodeVerification/styles.tsx

export default StyleSheet.create({
  root: {flex:1,marginHorizontal:20},
  title: {textAlign: 'center', fontSize: 30},
  codeFieldRoot: {marginTop: 20},
  cell: {
    width: 40,
    height: 40,
    lineHeight: 38,
    fontSize: 24,
    borderWidth: 2,
    borderColor: '#00000030',
    textAlign: 'center',
  },
  focusCell: {
    borderColor: '#000',
  },
});

Versions:
"react": "18.2.0",
"react-native": "0.72.5",
"react-native-confirmation-code-field": "^7.3.1"
iOS:17.0

Simulator Screenshot - iPhone SE (3rd generation) - 2023-10-09 at 13 02 19

@retyui
Copy link
Owner

retyui commented Oct 11, 2023

Thanks for reporting an issue, fixed and released: 7.3.2

diff: 7.3.1...7.3.2

@retyui retyui closed this as completed Oct 11, 2023
@ZainaliSyed
Copy link

@retyui

"react-native-confirmation-code-field": "7.3.2",

<CodeField
      ref={ref}
      value={value}
      onChangeText={onChangeText}
      {...cellProps}
      cellCount={CELL_COUNT}
      rootStyle={styles.codeFieldRoot}
      keyboardType="number-pad"
      textContentType="oneTimeCode"
      />

Using textContentType="oneTimeCode" works on Android but not on IOS . I updated to 7.3.2 as well still not able auto read SMS .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants