Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide leading zeroes on int number in concatNode #698

Merged
merged 6 commits into from Apr 6, 2020

Conversation

jakub-gonet
Copy link
Member

@jakub-gonet jakub-gonet commented Apr 2, 2020

Description

Fixes #677

When using concat node on Value which is an integer, Reanimated created a string with leading zeroes on Android and string without leading zeroes on IOS.

This PR fixes this and also fixes the localization of formatted numbers.

Reproduction Example

import React from 'react';
import { SafeAreaView, TextInput } from 'react-native';
import Animated from 'react-native-reanimated';
const { Value, concat, createAnimatedComponent } = Animated;

const price = new Value(44.5);
const AnimatedTextInput = createAnimatedComponent(TextInput);
const App = () => {
  return (
    <>
      <SafeAreaView>
        <AnimatedTextInput
          underlineColorAndroid="transparent"
          editable={false}
          {...{ text: concat('', price), style: { color: 'black' } }}
        />
      </SafeAreaView>
    </>
  );
};

export default App;

Pre-fix Screenshot:
image

Post-fix screenshots (localization with comma on decimals):
image

image

Copy link
Contributor

@jkadamczyk jkadamczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but ask @kmagiera if your changes resolve his issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

concat issue with Integer Value on Android
3 participants