react-native-otp-entry icon indicating copy to clipboard operation
react-native-otp-entry copied to clipboard

Cannot Reduce Gap Between Inputs

Open rick427 opened this issue 1 year ago • 1 comments

Describe the bug Setting a gap or margin on the containerStyle or pinCodeContainerStyle doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior The spacing or gap between input elements should change based on the spacing provided

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Mac
  • Device OS: Android
  • Device version: react native 0.73.7
  • Library version: 1.6.1

Additional context Add any other context about the problem here.

rick427 avatar May 13 '24 10:05 rick427

@rick427 Hi, thank you for bringing up this issue! I'll fix it asap. As a temporary workaround you can use this combination if props to deal with it:

<OtpInput theme={{ inputsContainerStyle: { justifyContent: 'flex-start', }, pinCodeContainerStyle: { marginRight: 5 } }}/>

anday013 avatar May 13 '24 12:05 anday013

Thanks

rick427 avatar May 26 '24 13:05 rick427

@rick427 Welcome! Could u please take a look at the PR I created #58 . The default width is 100% (I do not want to break the default behaviour for prev users), when you're setting gap, u need to set width to undefined or 'auto'. Is it acceptable solution, WDYT? image

anday013 avatar May 26 '24 15:05 anday013

Looks good

rick427 avatar May 28 '24 06:05 rick427