NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Input err icon not aligned to the right

Open Eylen opened this issue 9 years ago • 25 comments

I am writing a custom Component for the inputs in my application and I am trying to implement some kind of error feedback on them. The first problem comes when adding the icon, that's not beign aligned to the right, it always appears to the left inside the input.

react-native, react and native-base version

"react": "16.0.0-alpha.12", "react-native": "^0.47.0" "native-base": "^2.3.1"

Expected behaviour

The icon should appear to the right

Actual behaviour

The icon appears in the left

Steps to reproduce (code snippet or screenshot)

import React from "react";
import PropTypes from "prop-types";

import { Item, Label, Input, Text, Icon } from "native-base";

export default class FloatingInput extends React.Component {
    render(){
        return (
            <Item stackedLabel error={this.props.error?true:false}>
                <Label>{this.props.label}</Label>
                <Input 
                    secureTextEntry={this.props.obscure?true:false}
                    value={this.props.value}
                    onChangeText={this.props.onChangeText}
                    onBlur={this.props.validate}/>
                <Icon name='close-circle' />
                <Text>{this.props.error}</Text>
            </Item>
        );
    }
    
    static propTypes = {
        value: PropTypes.any.isRequired,
        label: PropTypes.string.isRequired,
        error: PropTypes.string,
        obscure: PropTypes.bool,
        onChangeText: PropTypes.func,
        validate: PropTypes.func
    };
}

Screenshot of emulator/device

screenshot_2017-09-01-11-03-11-035_host exp exponent

Is the bug present in both ios and android or in any one of them?

I have just tested this in Android

Eylen avatar Sep 01 '17 09:09 Eylen

I meet the same problem. Property stackedLabel and error, can not be used in Item together.

import React, { Component } from 'react';

import { Container, Header, Content, Item, Input, Icon, Label } from 'native-base';

export default class IconTextboxExample extends Component {

    render() {

        return (

            <Container>

                <Header />

                <Content>

                    <Item stackedLabel error>

                        <Label>Username</Label>

                        <Input />

                        <Icon name='close-circle' />

                    </Item>

            </Content>

        </Container>

        );

    }

}

walterjar avatar Sep 09 '17 13:09 walterjar

+1

CalebRoyer avatar Oct 10 '17 12:10 CalebRoyer

+1

renolmachado avatar Oct 13 '17 13:10 renolmachado

+1

matiruiz avatar Oct 13 '17 19:10 matiruiz

Closing this issue due to inactivity Please reopen this if the issue continues

SupriyaKalghatgi avatar Nov 20 '17 07:11 SupriyaKalghatgi

@SupriyaKalghatgi in order to trigger the bug, you need to use Item stackedLabel (emphasis mine) and also put a Label inside the Item stackedLabel.

I also got hit with this bug just today.

I tried putting alignSelf=flex-end on the Icon, still doesn't work.

ceefour avatar Dec 05 '17 00:12 ceefour

#1102

SupriyaKalghatgi avatar Dec 05 '17 06:12 SupriyaKalghatgi

Icon doesn't work inside StackeLabel. -_- I'm using v2.5.1

LasithaPrabodha avatar Jul 02 '18 11:07 LasithaPrabodha

Same here. It does not work to display an error icon using StackeLabel.

benzman81 avatar Jul 04 '18 13:07 benzman81

@SupriyaKalghatgi This is not a duplicate of #1102 - as the others said, this error is specific to using Item with stackedLabel. This is still happening. Can this please reopened?

marcelo-schroeder avatar Oct 20 '18 00:10 marcelo-schroeder

I still have this issue in v2.8.1. Can someone please help?

techbyvj avatar Nov 08 '18 21:11 techbyvj

still buggy

b33son avatar Jan 24 '19 20:01 b33son

Still buggy ... Can someone re-open this issue ?

qlerebours avatar Mar 28 '19 15:03 qlerebours

Still buggy in [email protected]

tofoli avatar May 08 '19 19:05 tofoli

still bug in native-base

Susmitha-Bogala avatar May 14 '19 15:05 Susmitha-Bogala

Also facing this issue, is there any workaround ? tried putting style={{ flexDirection: 'row-reverse' }} in Item but it made thing worse.

AmeerHamzaRiaz avatar Jun 29 '19 08:06 AmeerHamzaRiaz

Still buggy in [email protected] !

diegolaciar avatar Feb 06 '20 19:02 diegolaciar

Still a bug in native-base 2.13.8.. Can someone please reopen this issue?

MohiniGupta04 avatar Mar 12 '20 07:03 MohiniGupta04

FOR THE LOVE OF GOD SOMEONE REOPEN THIS ISSUE. I've been using Native Base for one day and so far have run into so many little bugs surrounding forms/inputs that it is quickly becoming unusable.

lizzieshipwreck avatar Mar 24 '20 01:03 lizzieshipwreck

this is still an issue @SupriyaKalghatgi . Please reopen

afrojuju1 avatar Apr 08 '20 20:04 afrojuju1