NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Items with floatingLabel are broken in release mode

Open jalpedersen opened this issue 8 years ago • 45 comments

Items with floatingLabels are not rendered correctly when building a release - only a single input is rendered and it looses all properties such as keyboardType, onChangeText, etc

The issue is not present in 2.7.2

node, npm, react-native, react and native-base version, expo version if used

node v10.9.0 npm 6.4.0 react-native 0.56.0 react 16.4.1 native-base 2.8.0

Expected behaviour

I would expect that the item would look and behave the same in dev and release mode

Actual behaviour

Only an input with no properties is rendered in release mode

Steps to reproduce should include code snippet and screenshot. Include code snippet in

minimal example including screenshots: https://github.com/jalpedersen/native_base_floating

Is the bug present in both iOS and Android or in any one of them?

Both iOS And Android

Any other additional info which would help us debug the issue quicker.

jalpedersen avatar Sep 06 '18 07:09 jalpedersen

Check commit https://github.com/GeekyAnts/NativeBase/commit/8664ffb75a262df3de336ddff1f6ebe283977cb0

SupriyaKalghatgi avatar Sep 07 '18 05:09 SupriyaKalghatgi

As the author of the original PR, I will investigate the exact cause of this break in production mode. Only reverting the commit will bring back the HOC issue with floating labels. Its not productive imho.

gvarandas avatar Sep 08 '18 03:09 gvarandas

@gvarandas yes, true that I take the basic functionality of this component i.e., label floats up on click, at highest priority. Than HOC and other functionalities.

You can go ahead and dig into this

SupriyaKalghatgi avatar Sep 10 '18 06:09 SupriyaKalghatgi

@SupriyaKalghatgi I've identified the cause of the problem. Should I open a new issue so we can discuss this? A new PR?

gvarandas avatar Sep 11 '18 17:09 gvarandas

Is this issue fixed?I a have similar issue in Release APK but floating labels are totally disappearing in Release version

Sourabhd1164 avatar Sep 17 '18 17:09 Sourabhd1164

@gvarandas yes, true that I take the basic functionality of this component i.e., label floats up on click, at highest priority. Than HOC and other functionalities.

You can go ahead and dig into this

Hi when make a new release? or how i genereted new release in my project? tks

vauruk avatar Sep 17 '18 21:09 vauruk

I find new bug, i dont find error in the code ! i need help! tks imagem nativebase

vauruk avatar Sep 18 '18 12:09 vauruk

@Sourabhd1164 Yes it is fixed and available on master

SupriyaKalghatgi avatar Sep 19 '18 05:09 SupriyaKalghatgi

@vauruk Will release this week

SupriyaKalghatgi avatar Sep 19 '18 05:09 SupriyaKalghatgi

@vauruk Can you share code snippet for above screenshot? Is it in debug or release mode? Version of NativeBase?

SupriyaKalghatgi avatar Sep 19 '18 05:09 SupriyaKalghatgi

@vauruk Can you share code snippet for above screenshot? Is it in debug or release mode? Version of NativeBase? Sorry @SupriyaKalghatgi , i using version master release, "Version of NativeBase?" - i download last release!, "Is it in debug or release mode?" - both My code:

/**

  • Sample React Native App
  • https://github.com/facebook/react-native *
  • @format
  • @flow */

import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Redirect } from 'react-router-dom'; import { Platform, StyleSheet, Image } from 'react-native'; import logo from '../../../assets/logo.jpg' import { Container, Header, Content, Button, Form, Item, Input, Label, Text, Toast, Spinner, Grid, Row, Col } from 'native-base' import { I18n, Analytics } from 'aws-amplify'; import { signIn } from '../../../redux/actions/auth'

import styles from '../Theme'

import Loading from '../Loading'

type Props = {}; class Login extends Component {

constructor(props) {
    super(props);
    this.state = {
        textEmail: null,
        textPassword: null
    }
}

handleSignIn = () => {
    if (this.state.textEmail && this.state.textEmail.length > 0
        && this.state.textPassword && this.state.textPassword.length) {
        this.props.signIn(this.state.textEmail, this.state.textPassword)
        Analytics.record('SignIn App')
    } else {
        Toast.show({
            text: 'Favor inserir usuário e senha!',
            //buttonText: 'Okay'
        })
    }

}

handleRegister = () => {
    this.props.history.push('/register')
}
handleForgot = () => {
    this.props.history.push('/forgot')
}

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

    if (currentUser) {
        // console.log('entrou login')
        return <Redirect to="/" />;
    }
    if (this.props.loadingAuth) {
        return (
            <Loading />
        );

    } else {
        return (
            <Container style={styles.container}>

                <Content style={{ padding: 5 }}>
                    <Grid style={styles.centerGrid}>
                        <Image source={logo} />
                    </Grid>
                    <Grid style={styles.centerGrid}>
                        {this.props.message ?
                            <Text style={{ color: 'red' }}>{I18n.get(this.props.message)}</Text>
                            : undefined}
                    </Grid>
                    <Form>
                        <Item floatingLabel >
                            <Label>{I18n.get('Email')}</Label>
                            <Input
                                value={this.state.textEmail}
                                keyboardType='email-address' maxLength={60}
                                onChangeText={(textEmail) => this.setState({ textEmail })} />
                        </Item>
                        <Item floatingLabel >
                            <Label>{I18n.get('Password')}</Label>
                            <Input
                                value={this.state.textPassword}
                                secureTextEntry={true}
                                onChangeText={(textPassword) => this.setState({ textPassword })} />
                        </Item>
                    </Form>
                    <Button block style={{ marginTop: 50 }} onPress={() => this.handleSignIn()}>
                        <Text style={{ color: '#ffffff' }}>{I18n.get('Sign In')}</Text>
                    </Button>
                    <Row>
                        <Col>
                            <Button block transparent onPress={() => this.handleForgot()}>
                                <Text>{I18n.get('Forgot Password')}</Text>
                            </Button>
                        </Col>
                        <Col>
                            <Button block transparent onPress={() => this.handleRegister()}>
                                <Text>{I18n.get('Register')}</Text>
                            </Button>
                        </Col>
                    </Row>
                </Content>
            </Container>
        );
    }
}

}

const mapStateToProps = (state) => ({ currentUser: state.auth.currentUser, loadingAuth: state.auth.loadingAuth, message: state.auth.message });

const mapDispatchToProps = dispatch => bindActionCreators({ signIn }, dispatch)

export default connect(mapStateToProps, mapDispatchToProps)(Login);

vauruk avatar Sep 19 '18 15:09 vauruk

@SupriyaKalghatgi Awesome! Thanks!

Sourabhd1164 avatar Sep 19 '18 22:09 Sourabhd1164

@SupriyaKalghatgi @vauruk Yes, checked the master branch just now and Im getting that cut-off bug too on both release and debug modes. Will share the code and screenshot if needed?

Sourabhd1164 avatar Sep 19 '18 22:09 Sourabhd1164

yes

SupriyaKalghatgi avatar Sep 20 '18 03:09 SupriyaKalghatgi

i have same problem. In production mode floating input not working. screen shot 2018-09-21 at 5 47 46 pm

you can see that.. i already add value but its still say empty field, and password field is visible too. secureTextEntry is not working, onChangeText is broken too. and floating label hide somewhere :)

ZeroCool00 avatar Sep 21 '18 12:09 ZeroCool00

Fixed with commit https://github.com/GeekyAnts/NativeBase/commit/c491eccfa5519d296a05b253f123f7df119eeacf, pushed to master image

SupriyaKalghatgi avatar Sep 24 '18 05:09 SupriyaKalghatgi

Thanks @SupriyaKalghatgi !

vauruk avatar Sep 24 '18 13:09 vauruk

still have same issue like @jalpedersen described on the top

marian-galik avatar Sep 24 '18 19:09 marian-galik

still have same issue like @jalpedersen described on the top

in mode release in Android!

vauruk avatar Sep 24 '18 22:09 vauruk

You need to eject theme to find the fix related to cropping label Else you can check the changes made in commit, and make those changes in your ejected theme (if already ejected)

SupriyaKalghatgi avatar Sep 25 '18 03:09 SupriyaKalghatgi