Code Monkey home page Code Monkey logo

Comments (10)

bhrott avatar bhrott commented on May 27, 2024

Hi,

Can you paste the code here?

from react-native-masked-text.

imanodaysoffdotcom avatar imanodaysoffdotcom commented on May 27, 2024

import React, { Component } from 'react';
import { Image, Dimensions, Linking, KeyboardAvoidingView } from 'react-native';
import { Container, Content, Card, CardItem, Text, View, InputGroup, Input, Button } from 'native-base';
import {TextInputMask} from 'react-native-masked-text';
import Parse from 'parse/react-native';
import { connect } from 'react-redux';
const window = Dimensions.get('window');
import styles from './styles';
import JustGiveInputView from './JustGiveInputView';
var heightOfImageContainer = 0;
var widthOfImageContainer = 0;
var {height, width} = Dimensions.get('window');

class JustGive extends Component { // eslint-disable-line

constructor(props) {
super(props);
this.state = {
selectedItem: undefined,
selectedTab: 0,
titheTotal: "0.00",
hashTag: '',
behaviorModals: 'position'
};

this.submitButtonClicked = this.submitButtonClicked.bind(this);

}

submitButtonClicked() {
console.log(this.refs.paymentAmount.getRawValue());
}

onChangeText(amount) {
console.log("text");
console.log("Setting state for value change " + amount);
this.setState({paymentAmount:amount})
}

render() { // eslint-disable-line
return (

  <View style={{flex: 1, backgroundColor: 'transparent'}}>

    <View style={{flex: 1, backgroundColor: 'transparent'}} onLayout={(event) => {
        var {x, y, width, height} = event.nativeEvent.layout;
        heightOfImageContainer = height;
        widthOfImageContainer = width;
      }}>
        <Image style={{flex: 1, width: null, height: heightOfImageContainer, marginTop: 20}} resizeMode={'contain'} source={require('../../../img/justgiveThankyou.png')} />
    </View>
    <View style={{flex: 0.75,  flexDirection: 'column', justifyContent: 'space-between',marginTop: 10, marginBottom: 15, marginHorizontal: 10}}>
        <View style={{flex: 1, borderRadius: 10, marginTop: 5, backgroundColor: '#390063', flexDirection: 'row'}}>
          <Text style={{flex: 1, color: 'white', marginLeft: 15, alignSelf:'center'}}>Enter Amount Here</Text>
          <View style={{flex: 0.65, height:35, alignSelf:'center', justifyContent:'center', marginRight: 10, backgroundColor: 'white', borderRadius: 10}}>
            <TextInputMask ref={'paymentAmount'} value={this.state.paymentAmount} onChangeText={this.onChangeText.bind(this)} style={{flex:1, marginHorizontal: 10}} type={'money'} options={{ unit: '$', separator: '.', delimiter: ',' }} />
          </View>
        </View>
        <View style={{flex: 1, borderRadius: 10, marginTop: 5, backgroundColor: '#390063', flexDirection: 'row'}}>
          <Text style={{flex: 1, color: 'white', marginLeft: 15, alignSelf:'center'}}>Hashtag (Optional)</Text>
          <View style={{flex: 0.65, height:35, alignSelf:'center', marginRight: 10, backgroundColor: 'white', borderRadius: 10}}>
            <InputGroup style={{flex: 0.5, alignSelf:'center', textAlign:'center'}} borderType='rounded' >
                          <Input ref={'hashtag'} onChangeText={(hastagvalue) => this.setState({hashtag:hastagvalue})} keyboardType={'alpha'} placeholder=''/>
            </InputGroup>
          </View>
        </View>
    </View>

    <View style={{flex: 0.45, backgroundColor: '#FF8162', flexDirection: 'column', justifyContent: 'center'}} onLayout={(event) => {
        var {x, y, width, height} = event.nativeEvent.layout;
        heightOfSubmitContainer = height;
      }}>
      <View style={{flex: 1, backgroundColor: 'transparent', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end',}}>
        <Button ref="paymentButton" onPress={() => {this.submitButtonClicked()}} color="white" style={{width:100, height: 35, backgroundColor: '#390063', marginRight: 20, alignSelf: 'center'}}>Submit</Button>
      </View>
    </View>

  </View>

);

}
}

from react-native-masked-text.

bhrott avatar bhrott commented on May 27, 2024

I can't reproduce this.

Look to this sample:

mask_working mov

Has some errors on console?
Can you send me prints of the state?

from react-native-masked-text.

imanodaysoffdotcom avatar imanodaysoffdotcom commented on May 27, 2024

Please try to type in Ten dollars or maybe even 100.00.

from react-native-masked-text.

imanodaysoffdotcom avatar imanodaysoffdotcom commented on May 27, 2024

The erros is only when trying to add trailing zero's consecutively. For example 10000 which should be 10,000 but instead only 0.01 shows up

from react-native-masked-text.

bhrott avatar bhrott commented on May 27, 2024

Can you send me a gif or video reproducing this error?

money_mask_trailling mov

I realy can't reproduce this here =/

from react-native-masked-text.

imanodaysoffdotcom avatar imanodaysoffdotcom commented on May 27, 2024

Sorry, i got it working. Thanks for your prompt response

from react-native-masked-text.

bhrott avatar bhrott commented on May 27, 2024

Ok,

I will close this for now =).

from react-native-masked-text.

masiamj avatar masiamj commented on May 27, 2024

I'm actually encountering this same error. @imanodaysoffdotcom How did you end up resolving?

from react-native-masked-text.

imanodaysoffdotcom avatar imanodaysoffdotcom commented on May 27, 2024

from react-native-masked-text.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.