uhlryk / react-dynamic-number Goto Github PK
View Code? Open in Web Editor NEWHighly customizable react form component for numbers
License: MIT License
Highly customizable react form component for numbers
License: MIT License
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; }}
/>
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?
There needs to be a focus
method on the component so parent elements can focus on the input.
Countries in Asia (Vietnam for example) use this format for currency: 10.000.000 but doing so gives the following error: 'Failed prop type: thousand have to be bool value or space character'
I have forked your repo and made the change here: patrickbadley@01fd2fa
Similar to normal react input. This will set value only once.
If init model value is 0.5 and comma is used as view decimal separator, the input will be empty.
We can use mocha and test only logic
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!
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'
It would be good to be able to set a minimum and/or maximum value that the user can enter.
<DynamicNumber min={0} max={100} ... />
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?
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
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
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.
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!
Can you added features for this package for support when user blur, focus, keypress in textfield?
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......
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.
Control and demo is unusable in IE 10, it throws:
Unable to get property 'separator' of undefined or null reference error
Its probably due to an issue with babel which was fixed in 6.14
babel/babel#3527
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.