Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

304
Vistas
On iOS native-base input scrolls away(hiding) when keyboard is shown

I use the input component from native-base (v2). When a user focuses the input, the value scrolls away. The text cursor also disappears.

InputField.js

const InputField = ({
  style,
  iconStyle,
  labelStyle,
  type,
  value,
  disabled,
  label,
  placeholder,
  onChangeText,
}) => {
  return (
    <Item style={[style]}>
      <Icon style={[iconStyle]} active name={type.icon} type={type.iconType} />
      <Label style={[labelStyle]}>{label}</Label>
      <Content
        contentContainerStyle={{
          flexDirection: "row",
          alignItems: "center",
        }}
      >
        <Input
          value={value}
          disabled={disabled}
          autoCompleteType={type.autoCompleteType}
          autoCorrect={type.autoCorrect}
          autoCapitalize={type.autoCapitalize}
          keyboardType={type.keyboardType}
          onChangeText={onChangeText}
          secureTextEntry={type.secureTextEntry}
          maxLength={type.maxLength}
          placeholder={placeholder}
        />
      </Content>
    </Item>
  );
};

Profile.jsx

<InputField
                style={{ flex: 1, flexDirection: "row" }}
                labelStyle={{ flex: 1 }}
                type={InputFieldTypes.City}
                value={city}
                label={I18n.t("profile.city") + ":"}
                onChangeText={(text) => {
                  setCity(text);
                  setEdit(true);
                }}
              />

The behaviour I'm experiencing. iOs

I have tried giving it more space to see what is going on, but it still scrolls out of view. Android seems fine. Remove padding and margin from input had no effect. Neither did forcing it to only have one line.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I found out that the issue was caused by the Content component. Just removing it fixed the issue.

const InputField = ({
  style,
  iconStyle,
  labelStyle,
  type,
  value,
  disabled,
  label,
  placeholder,
  onChangeText,
}) => {
  return (
    <Item style={[style]}>
      <Icon style={[iconStyle]} active name={type.icon} type={type.iconType} />
      <Label style={[labelStyle]}>{label}</Label>
      
        <Input
          value={value}
          disabled={disabled}
          autoCompleteType={type.autoCompleteType}
          autoCorrect={type.autoCorrect}
          autoCapitalize={type.autoCapitalize}
          keyboardType={type.keyboardType}
          onChangeText={onChangeText}
          secureTextEntry={type.secureTextEntry}
          maxLength={type.maxLength}
          placeholder={placeholder}
        />

    </Item>
  );
};
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda