Skip to content

Commit

Permalink
- Remove extra conditions for allow changes check
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed Sep 30, 2018
1 parent fc5c800 commit e28ef72
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/number_format.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,7 @@ class NumberFormat extends React.Component {
value.length > lastValue.length
|| !value.length ||
start === end ||
(start === 0 && end === lastValue.length) ||
(selectionStart === 0 && selectionEnd === lastValue.length) ||
(start === leftBound && end === rightBound) ||
(selectionStart === leftBound && selectionEnd === rightBound)
) {
return value;
Expand Down
2 changes: 1 addition & 1 deletion test/library/input_numeric_format.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ describe('Test NumberFormat as input with numeric format options', () => {

it('should should allow ctrl + a -> decimalSeparator', () => {
const wrapper = shallow(<NumberFormat decimalSeparator={'.'} prefix={'$'} value="$34.35"/> );
wrapper.find('input').simulate('change', getCustomEvent('.', 1, 1));
simulateKeyInput(wrapper.find('input'), '.', 0, 6);
expect(wrapper.state().value).toEqual('$.');
});

Expand Down

0 comments on commit e28ef72

Please sign in to comment.