Comments (10)
Hi,
Can you paste the code here?
from react-native-masked-text.
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.
I can't reproduce this.
Look to this sample:
Has some errors on console?
Can you send me prints of the state?
from react-native-masked-text.
Please try to type in Ten dollars or maybe even 100.00.
from react-native-masked-text.
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.
Can you send me a gif or video reproducing this error?
I realy can't reproduce this here =/
from react-native-masked-text.
Sorry, i got it working. Thanks for your prompt response
from react-native-masked-text.
Ok,
I will close this for now =).
from react-native-masked-text.
I'm actually encountering this same error. @imanodaysoffdotcom How did you end up resolving?
from react-native-masked-text.
from react-native-masked-text.
Related Issues (20)
- cel-phone is not working on IOS phone?
- getRawValue is not a function HOT 2
- How set 9 as require digit in mask? HOT 1
- Type Money adds zero to the left HOT 4
- Can't remove white spaces separator from the middle of the masked phone number HOT 2
- How to make a mask look like this +7 (___) ___-__-__ HOT 4
- Type Money adds zero to the left when you type fast HOT 2
- Show the delimiter before rather than after the key press
- Using with React-Hook-Form's Controller and validation
- Web: Text cursor goes to the end after editing the middle of an input HOT 2
- How to put two masks in 1 input HOT 1
- Add Placeholder HOT 1
- date-and-time - 2 high severity vulnerabilities HOT 1
- integer and decimal mask
- How to mock react-native-masked-text to work with jest test cases
- Custom mask: '***' accepted white space
- Integração com react_native_masked_input
- Input ref is not correctly typed
- Prefix disappear after clear field
- Render Error: Cannor read property 'defaultValue' of undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-masked-text.