31 questions
0
votes
0
answers
36
views
React: Cannot enter a value while testing NumericFormat embedded in Controller
I have a NumericFormat as part of a react-hook-form Controller which vitest renders with jest-dom. When trying to enter some test data into it, its value does not change.
The Component:
// ...
1
vote
0
answers
291
views
React number format first number overwrite default value
I'm using react-number-format decimal amount. How do I make sure that default value is zero, but when a user enters the first number, (say 1 for example) it results in the total input value being 1 ...
0
votes
1
answer
1k
views
React Material UI Textfield with Thousands Separator
I want to format my textfield with a $ and thousands separators. I.e. $120,000 instead of 120000. I get two warnings:
1.) Warning: Failed prop type: The prop name is marked as required in ForwardRef(...
4
votes
0
answers
581
views
How can I use persian numbers with react-number-format
I created this component with react-number-format
const NumberFormatCustom = React.forwardRef(function NumberFormatCustom(
props,
ref
) {
const { onChange, ...other } = props;
return (
<...
0
votes
1
answer
661
views
How to get floatValue automatically from react-number-format inside a antd Form.Item?
I'm looking for a way to antd Form get automatically a floatValue from react-number-format.
`<Form.Item
label="My label"
name="fator"
>
&...
0
votes
2
answers
985
views
Why does my custom TextField reset to its default value when content is deleted?
I created a custom FormCurrencyField that uses MUI TextField, react-number-format NumericFormat, and react-hook-form useController.
It works: the values are correctly formatted as currencies and the ...
1
vote
1
answer
2k
views
How to remove the mask in react-number-format?
How do I delete a form from
When I submit a form, it takes the form of: "+7 (123) 123-1231". But I need my phone number to be sent in this form: 71231231231 .
How do I do this?
Code:
<...
1
vote
2
answers
4k
views
How can I disable react-number-format input
I'd like to disable react-number-format input, but this component doesn't have disabled property.
How can I disable it?
2
votes
1
answer
2k
views
Place Holder not visible react-number-format
Current behavior
Place holder is not visible for phone number mask
Expected behavior
Place holder to be visible and on focus the input format and mask to be applied while user is entering data
...
2
votes
0
answers
740
views
NumberFormat doesn't take the value from updated state on change
I am trying to prevent typing 0 (zero) at the beginning of phone number after the country code.
I am using:
Next.Js
NumberFormat (react-number-format)
The problem:
I was able to prevent 0 from ...
0
votes
0
answers
465
views
How to use this component
Took this component from MUI docs
export interface CustomProps {
onChange: (event: { target: { name: string; value: string } }) => void;
name: string;
}
const NumberFormatCustom = React....
1
vote
1
answer
957
views
Why does react number format input field lose focus in nextjs on production build
Why some of the input fields in our nextjs project rendered using react-number-format lose focus while typing? No errors are being thrown and the build logs does not indicate that something has been ...
10
votes
1
answer
21k
views
How do I integrate React hook form with NumberFormat (react-number-format)?
I am trying to use React hook form with NumberFormat without Controller and without ReactDOM.findDOMNode (which is deprecated and discouraged). The following code works
import React from 'react';
...
1
vote
1
answer
2k
views
isDirty issue with react hook form and react number format
I'm using react-number-format with react-hook-form Controller for a currency input.
The formState does not update correctly: isDirty and dirtyFields do not seem to update when editing the masked ...
2
votes
1
answer
1k
views
How to set HMTL attribute to Material UI InputProps?
I am using react-number-format with Material UI Textfield and I'm trying to add a max property of 100 on my field. e.g numbers above 100 are not allowed.
How can I do this using HTML attribute: min?
...
5
votes
1
answer
3k
views
Input loses focus and each key stroke - TextField react-format-number
I have created an input component (InputComponent) using react-number-format. This component accepts only a string numerical value with one decimal. Example: "12.5" or "12" but not ...