@@ -694,35 +694,34 @@ class NumberFormat extends React.Component {
694694
695695 // check whether the deleted portion has a character that is part of a format
696696 const deletedValues = lastValue . substr ( start , end - start ) ;
697- const formatGotDeleted = ! ! [ ...deletedValues ] . find ( ( deletedVal , idx ) => this . isCharacterAFormat ( idx + start , lastValue ) ) ;
697+ const formatGotDeleted = ! ! [ ...deletedValues ] . find ( ( deletedVal , idx ) =>
698+ this . isCharacterAFormat ( idx + start , lastValue ) ,
699+ ) ;
698700
699701 // if it has, only remove characters that are not part of the format
700- if ( formatGotDeleted ) {
701- const deletedValuePortion = lastValue . substr ( start )
702+ if ( formatGotDeleted ) {
703+ const deletedValuePortion = lastValue . substr ( start ) ;
702704 const recordIndexOfFormatCharacters = { } ;
703705 const resolvedPortion = [ ] ;
704706 [ ...deletedValuePortion ] . forEach ( ( currentPortion , idx ) => {
705- if ( this . isCharacterAFormat ( idx + start , lastValue ) ) {
707+ if ( this . isCharacterAFormat ( idx + start , lastValue ) ) {
706708 recordIndexOfFormatCharacters [ idx ] = currentPortion ;
707709 } else if ( idx > deletedValues . length - 1 ) {
708710 resolvedPortion . push ( currentPortion ) ;
709711 }
710- } )
712+ } ) ;
711713
712- Object . keys ( recordIndexOfFormatCharacters ) . forEach ( idx => {
713- if ( resolvedPortion . length > idx ) {
714+ Object . keys ( recordIndexOfFormatCharacters ) . forEach ( ( idx ) => {
715+ if ( resolvedPortion . length > idx ) {
714716 resolvedPortion . splice ( idx , 0 , recordIndexOfFormatCharacters [ idx ] ) ;
715717 } else {
716- resolvedPortion . push ( recordIndexOfFormatCharacters [ idx ] )
718+ resolvedPortion . push ( recordIndexOfFormatCharacters [ idx ] ) ;
717719 }
718- } )
720+ } ) ;
719721
720722 value = lastValue . substr ( 0 , start ) + resolvedPortion . join ( '' ) ;
721723 }
722724
723-
724-
725-
726725 //for numbers check if beforeDecimal got deleted and there is nothing after decimal,
727726 //clear all numbers in such case while keeping the - sign
728727 if ( ! format ) {
0 commit comments