Skip to content

Commit

Permalink
Merge pull request #27 from AZIMAT/master
Browse files Browse the repository at this point in the history
Fixing RTL issue.
  • Loading branch information
fpena authored Dec 28, 2019
2 parents e8c7817 + f409f75 commit ed8802b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { View, TextInput, TouchableWithoutFeedback, Clipboard, Keyboard, Platform } from 'react-native'
import { View, TextInput, TouchableWithoutFeedback, Clipboard, Keyboard, Platform, I18nManager, } from 'react-native'
import PropTypes from 'prop-types'
import styles from './styles'
import { isAutoFillSupported } from './helpers/device'
Expand Down Expand Up @@ -182,7 +182,7 @@ export default class OTPInputView extends Component {
<View pointerEvents="none" key={index + "view"}>
<TextInput
underlineColorAndroid='rgba(0,0,0,0)'
style={selectedIndex === index ? [defaultTextFieldStyle, codeInputFieldStyle, codeInputHighlightStyle] : [defaultTextFieldStyle, codeInputFieldStyle]}
style={selectedIndex === index || digits[index] ? [defaultTextFieldStyle, codeInputFieldStyle, codeInputHighlightStyle] : [defaultTextFieldStyle, codeInputFieldStyle]}
ref={ref => { this.fields[index] = ref }}
onChangeText={text => {
this.handleChangeText(index, text)
Expand Down Expand Up @@ -220,12 +220,12 @@ export default class OTPInputView extends Component {
}}
>
<View
style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: '100%' }}
style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: '100%' }}
>
{this.renderTextFields()}
</View>
</TouchableWithoutFeedback>
</View>
);
}
}
}

0 comments on commit ed8802b

Please sign in to comment.