Skip to content

Commit

Permalink
added formFieldsDirection for CreditCardInput, also updated readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
octocat001 committed Aug 31, 2020
1 parent c731ce1 commit 8f06b03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ LiteCreditCardInput does not support `requiresName`, `requiresCVC`, and `require
|requiresPostalCode | PropTypes.bool | Shows postalCode field<br/> Default to `false` |
|validatePostalCode | PropTypes.func | Function to validate postalCode, expects `incomplete`, `valid`, or `invalid` as return values|
|allowScroll | PropTypes.bool | enables horizontal scrolling on CreditCardInput <br/> Defaults to `false` |
|formFieldsDirection | PropTypes.string | Set "horizontal" or "vertical" scrolling orientation (it does not work dynamically) <br/> Defaults to `horizontal` |
|cardBrandIcons | PropTypes.object | brand icons for CardView. see `./src/Icons.js` for details |
| additionalInputsProps | PropTypes.objectOf(TextInput.propTypes) | An object with Each key of the object corresponding to the name of the field. Allows you to change all props documented in [RN TextInput](https://facebook.github.io/react-native/docs/textinput.html).

Expand Down
6 changes: 4 additions & 2 deletions src/CreditCardInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default class CreditCardInput extends Component {
cardBrandIcons: PropTypes.object,

allowScroll: PropTypes.bool,
formFieldsDirection: PropTypes.string,

This comment has been minimized.

Copy link
@arunkumarmobideveloper

arunkumarmobideveloper Aug 17, 2021

its not coming vertical please suggest


additionalInputsProps: PropTypes.objectOf(PropTypes.shape(TextInput.propTypes)),
};
Expand Down Expand Up @@ -91,6 +92,7 @@ export default class CreditCardInput extends Component {
invalidColor: "red",
placeholderColor: "gray",
allowScroll: false,
formFieldsDirection: "horizontal",
additionalInputsProps: {},
};

Expand Down Expand Up @@ -143,7 +145,7 @@ export default class CreditCardInput extends Component {
const {
cardImageFront, cardImageBack, inputContainerStyle,
values: { number, expiry, cvc, name, type }, focused,
allowScroll, requiresName, requiresCVC, requiresPostalCode,
allowScroll, formFieldsDirection, requiresName, requiresCVC, requiresPostalCode,
cardScale, cardFontFamily, cardBrandIcons,
} = this.props;

Expand All @@ -161,7 +163,7 @@ export default class CreditCardInput extends Component {
expiry={expiry}
cvc={cvc} />
<ScrollView ref="Form"
horizontal
horizontal={formFieldsDirection=="vertical"?false:true}
keyboardShouldPersistTaps="always"
scrollEnabled={allowScroll}
showsHorizontalScrollIndicator={false}
Expand Down

0 comments on commit 8f06b03

Please sign in to comment.