@@ -137,29 +137,29 @@ export class FloatEditor implements Editor {
137137 if ( ! validationResults . valid ) {
138138 return validationResults ;
139139 }
140- } else if ( isNaN ( elmValue as number ) || ( decPlaces === 0 && ! / ^ ( \d + ( \. ) ? ( \d ) * ) $ / . test ( elmValue ) ) ) {
140+ } else if ( isNaN ( elmValue as number ) || ( decPlaces === 0 && ! / ^ [ - + ] ? ( \d + ( \. ) ? ( \d ) * ) $ / . test ( elmValue ) ) ) {
141141 // when decimal value is 0 (which is the default), we accept 0 or more decimal values
142142 return {
143143 valid : false ,
144144 msg : errorMsg || Constants . VALIDATION_EDITOR_VALID_NUMBER
145145 } ;
146- } else if ( minValue !== undefined && minValue !== undefined && ( floatNumber < minValue || floatNumber > maxValue ) ) {
146+ } else if ( minValue !== undefined && maxValue !== undefined && floatNumber !== null && ( floatNumber < minValue || floatNumber > maxValue ) ) {
147147 // MIN & MAX Values provided
148148 // when decimal value is bigger than 0, we only accept the decimal values as that value set
149149 // for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
150150 return {
151151 valid : false ,
152152 msg : errorMsg || Constants . VALIDATION_EDITOR_NUMBER_BETWEEN . replace ( / { { minValue} } | { { maxValue} } / gi, ( matched ) => mapValidation [ matched ] )
153153 } ;
154- } else if ( minValue !== undefined && floatNumber <= minValue ) {
154+ } else if ( minValue !== undefined && floatNumber !== null && floatNumber <= minValue ) {
155155 // MIN VALUE ONLY
156156 // when decimal value is bigger than 0, we only accept the decimal values as that value set
157157 // for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
158158 return {
159159 valid : false ,
160160 msg : errorMsg || Constants . VALIDATION_EDITOR_NUMBER_MIN . replace ( / { { minValue} } / gi, ( matched ) => mapValidation [ matched ] )
161161 } ;
162- } else if ( maxValue !== undefined && floatNumber >= maxValue ) {
162+ } else if ( maxValue !== undefined && floatNumber !== null && floatNumber >= maxValue ) {
163163 // MAX VALUE ONLY
164164 // when decimal value is bigger than 0, we only accept the decimal values as that value set
165165 // for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
0 commit comments