react-native-material-dropdown icon indicating copy to clipboard operation
react-native-material-dropdown copied to clipboard

rtl support

Open bitpaydotir opened this issue 6 years ago • 1 comments

How to rtl dropdown I used all the available options but did not work please help

bitpaydotir avatar Sep 04 '18 06:09 bitpaydotir

You can control RTL or LTR using renderBase prop. Say you have a Row component that handles the direction

const styles = StyleSheet.create({
  default: {
    display: 'flex',
    flexDirection: 'row', // Here you can control the direction 
  },
});

function Row(props) {
  const style = Array.isArray(props.style) ? props.style : [props.style];

  return (
    <View {...props} style={[styles.default, ...style]}>
      {props.children}
    </View>
  );
}

Then you can just use it as follows.

<Dropdown
...dropdownProps
renderBase={props => {
            return (
              <Row>
                <Text>
                  {props.title}
                </Text>
                {props.renderAccessory() /* This part is the arrow */}
              </Row>
            );
          }}
>

zmtmaster avatar May 25 '20 07:05 zmtmaster