Code Monkey home page Code Monkey logo

react-dynamic-number's People

Contributors

gdotdesign avatar haydnhkim avatar msander avatar uhlryk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-dynamic-number's Issues

Unable to focus using ref

I'm trying to focus on DynamicNumber, but it throws error as cannot read focus of null. I'm targeting from onChange of another component. Simple example of what I have done:

xyz = () => {
this.abc.focus();
}

<DynamicNumber
ref={(input) => { this.abc = input; }}
/>

Support for unicode numerals

Currently it seems that this module has support for english numerals only.
Can it be further enhanced to allow input of unicode numerals as well?

Add focus support

There needs to be a focus method on the component so parent elements can focus on the input.

add tests

We can use mocha and test only logic

Add id value

Hey, can you please add an id to the input field? Even if I add it to the DynamicNumber element, when I inspect the code, those values are not there.
For example:

<DynamicNumber
  thousand={','}
  integer={7}
  type='number'
  min={0}
  id='someIdHere'
  ref='someRefHere'
  onChange={this.valueChange}
  value={this.state.something} />

Generated input:
<input type='text' class='some-css-class' value='something'>

Thanks!

move react to peerDependencies

Can you please move react to devDependencies or peerDependencies.
Otherwise react is included twice in any application that uses your component and version of React different than yours.
Another possible option is to make react dependency more loose. Like '>= 0.14.5' instead of '^0.14.5'

Fraction is error

Let's say I have 2 input fields. Both of them have fraction={1}. When I input in first field 2.35, in visual it is 2.3 and that's what I want. But when I move to second field, then I start to input some values, the first field's value become to 0 again. Then I reload page. Now, I input in first field 2.3, then I move to second field and I start to input some values, the first field is fine with value 2.3. I think there's something missed with fraction props. Is it possible to fix this?

Duplicate module name: ViewportMetrics

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: ViewportMetrics
  Paths: /node_modules/react-dynamic-number/node_modules/react/lib/ViewportMetrics.js collides with /node_modules/react/lib/ViewportMetrics.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
  Duplicate module name: ViewportMetrics
  Paths: /node_modules/react-dynamic-number/node_modules/react/lib/ViewportMetrics.js collides with /node_modules/react/lib/ViewportMetrics.js

This error is caused by a @providesModule declaration with the same name accross two different files.
    at HasteMap._updateHasteMap (/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:162:15)
    at /node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:127:25

React 16 Warning

Starting from react 16, I see that assigning values to "this.state" in componentWillReceiveProps, will raise a warning which suggests to use ".setState".

Can you please update this in the next version? Thanks in advance

check what if we pass float value and in props we set thousand with dot

below statement need to be checked.
this.calculator.calculate is designed to test raw string values if they have certain format and to change them to js numbers. For example If we set in props decimal separator comma, thousand separator dot. And we pass normal javascript float 1234.1234 to calculate it will treat this value as raw string and remove dot (because dot in this configuration means thousand separator).
If Im right then we need new method similar to calculate which transform correct js numbers to certain string view values.

ES5 support

I get multiple errors when using the module as follows:
var DynamicNumer = require('react-dynamic-number')

I guess the reason is that module doesn't work with es5, commonjs?

Cheers!

Refs Problem

Using refs seemed to work fine in our DEV environment set in the react-router. Though when put into production mode it no longer recognized this element component as a valid react component and threw an error due to the ref being added.

The error read:
Minified React error #120; visit http://facebook.gitbhub.io/react/docs/error-decoder.html?invariant=120 for the full message or use the non-minified dev environment for full errors......

PlaceHolder Values

The placeholder value seems to be set at the value 0 no matter what is placed in this element. Is there some way to make this value empty so the initial value is not 0.

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.