Skip to content

Commit 11af4c5

Browse files
committed
Update demo link for fixeDecimal scale
1 parent b6459d4 commit 11af4c5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

documentation/v5/docs/numeric_format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ import { NumericFormat } from 'react-number-format';
171171
<summary>
172172
Demo
173173
</summary>
174-
<iframe src="https://codesandbox.io/embed/fixeddecimalscale-demo-kwbnev?fontsize=14&hidenavigation=1&theme=dark&view=preview"
174+
<iframe src="https://codesandbox.io/s/fixeddecimalscale-demo-3jnvz7?fontsize=14&hidenavigation=1&theme=dark&view=preview"
175175
className='csb'
176176
title="allowNegative-demo"
177177
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"

test/library/input.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
getInputValue,
1717
render,
1818
wait,
19-
simulateNativeKeyInput
19+
simulateNativeKeyInput,
2020
} from '../test_util';
2121
import PatternFormat, { usePatternFormat } from '../../src/pattern_format';
2222
import NumberFormatBase from '../../src/number_format_base';
@@ -287,19 +287,19 @@ describe('NumberFormat as input', () => {
287287
simulateKeyInput(wrapper.find('input'), '8', 0, format.length);
288288
expect(getInputValue(wrapper)).toEqual('+1 (8__) ___ _ __ US');
289289
});
290-
290+
291291
it('should give proper value when format character has number #652', () => {
292292
//https://github.com/s-yadav/react-number-format/issues/652#issuecomment-1278200770
293293
const spy = jasmine.createSpy();
294-
const wrapper = mount(<PatternFormat format="13###" mask="_" onValueChange={spy} />);
294+
const wrapper = mount(<PatternFormat format="13###" mask="_" onValueChange={spy} />);
295295
simulateKeyInput(wrapper.find('input'), '3', 0);
296296
simulateKeyInput(wrapper.find('input'), '4', 3);
297297
expect(spy.calls.argsFor(1)[0]).toEqual({
298298
formattedValue: '1334_',
299299
value: '34',
300300
floatValue: 34,
301301
});
302-
})
302+
});
303303

304304
it('should not allow replacing all characters with number when formatting is present for NumericFormats', () => {
305305
//check for numeric input
@@ -558,7 +558,7 @@ describe('NumberFormat as input', () => {
558558

559559
it('should not give wrong value, when user enter more number than the given hash in PatternFormat #712', async () => {
560560
const Component = () => {
561-
const [value, setValue] = useState("1232345124");
561+
const [value, setValue] = useState('1232345124');
562562
return (
563563
<div>
564564
<PatternFormat
@@ -572,17 +572,17 @@ describe('NumberFormat as input', () => {
572572
/>
573573
<span data-testid="value">{value}</span>
574574
</div>
575-
)
576-
}
575+
);
576+
};
577577

578-
const {input, view} = await render(<Component />);
578+
const { input, view } = await render(<Component />);
579579
simulateNativeKeyInput(input, '1', 1, 1);
580580
await wait(100);
581581

582582
expect(input.value).toEqual('(112) 3234 512');
583583
const value = await view.getByTestId('value');
584584
expect(value.innerText).toEqual('1123234512');
585-
})
585+
});
586586

587587
describe('Test masking', () => {
588588
it('should allow mask as string', () => {

0 commit comments

Comments
 (0)