Skip to content

Labels are not displayed on iOS #72

@ghost

Description

Hi !

Labels are not displayed on iOS.
On Android, it works.
image : https://ibb.co/pbyDBrW

` import React from 'react';
import { View } from 'react-native';
import Input from 'react-native-select-input-ios';

import FontText from '../../FontText';
import style from './style';

class SelectInput extends React.Component {

constructor(props) {
super(props);

this.state = {
  valueInput: this.props.value
};

}

onValueChange = (value) => {

for(const element of this.props.options) {
  if (element.value === value) {
    this.setState({
      valueInput: element.label
    });
    break;
  }
}

this.props.input.onChange(value);

}

render() {
const { input } = this.props;

return (

  <View style={[style.view, this.props.containerStyle]}>

    <FontText 
      style={[style.text, this.props.textStyle]}
    >
        {this.props.label}
    </FontText>

    <Input

      style={[
        style.input, 
        this.props.inputStyle,
        this.props.meta.warning === undefined ? style.inputValid : style.inputInvalid
      ]}
      labelStyle={[
        style.labelStyle,
        this.props.labelStyle
      ]}

      onValueChange={this.onValueChange}
      onSubmitEditing={this.onValueChange}
      onBeginEditing={input.onFocus}
      onBlur={input.onBlur}

      mode={this.props.mode}
      value={this.state.valueInput}
      options={this.props.options}
    />

  </View>
);

}
}

export default SelectInput;
`
Is it normal ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions