React-native-paper: TextInput placeholder RTL support?

Created on 17 Apr 2018  路  10Comments  路  Source: callstack/react-native-paper

Hi (-:
When using TextInput in RTL mode, the header is placed right side (as it should), but the placeholder text is placed left. How can we tell the placeholder text to also be on the right side:

unnamed

needs investigation

All 10 comments

@yaronlevi does text-align: right works for you in the meantime?

Unfortunately, setting text-align:right does not work. Is their a rough estimation on when RTL support to TextInput might be available?

Please can you you give me the code of TextInput in RTL mode
thanks @ferrannp
I want to support icon visible password in the textInput

@saharjedidi What do you mean exactly saying give me the code? It's an open source project so feel free to fork/clone it and use it according to your needs.

@Trancever
this is my code
label=' 賰賱賲丞 丕賱賲乇賵乇'
mode='outlined'
secureTextEntry='true'
underlineColorAndroid={'rgba(0,0,0,0)'}
style={this.getStyle().TextInp} text='white'
direction ='rtl'
value={this.state.text}
editable= 'true'
onChangeText={password => this.setState({ password })}
underlineColor='transparent'
editable= 'true'
theme={{ colors: { placeholder: 'white', text: 'white', primary: 'white',underlineColor:'transparent',background : '#003489'}}}

I want to drag an icon like this and I don't know how ?
photo
thanks a lot for your reply

H @Trancever @saharjedidi
Is there any way to set RTL option for placeholder in android?

Setting textAlign: 'left' || 'right' is working fine with iOS but not with android

The text should be right to left but not flipped

Hi, On your App.js file add

import { I18nManager } from 'react-native';
I18nManager.allowRTL(true)
I18nManager.forceRTL(true)

Like:

import React from 'react';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { I18nManager } from 'react-native';
import Home from './src/Pages/Home';
import Login from './src/Pages/Login';
import Splash from './src/Pages/Splash';
I18nManager.allowRTL(true)
I18nManager.forceRTL(true)


const SplashScreen = createSwitchNavigator({

  Splash,
  Login,
  Home,
}, {
  navigationOptions: {
    headerVisible: false,
  }
})

export default createAppContainer(SplashScreen)

goodLuck

Hi, On your App.js file add

import { I18nManager } from 'react-native';
I18nManager.allowRTL(true)
I18nManager.forceRTL(true)

Like:

import React from 'react';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { I18nManager } from 'react-native';
import Home from './src/Pages/Home';
import Login from './src/Pages/Login';
import Splash from './src/Pages/Splash';
I18nManager.allowRTL(true)
I18nManager.forceRTL(true)


const SplashScreen = createSwitchNavigator({

  Splash,
  Login,
  Home,
}, {
  navigationOptions: {
    headerVisible: false,
  }
})

export default createAppContainer(SplashScreen)

goodLuck

What it will do?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

satya164 picture satya164  路  4Comments

ButuzGOL picture ButuzGOL  路  3Comments

ButuzGOL picture ButuzGOL  路  4Comments

zxccvvv picture zxccvvv  路  4Comments

alikazemkhanloo picture alikazemkhanloo  路  4Comments