@@ -51,7 +51,6 @@ export const InputForSelectedOption = ({
51
51
const handleFocusChange = ( { focused : isFocused } ) => {
52
52
setFocused ( isFocused )
53
53
}
54
- const minValue = filterTypeRadio === CUSTOM_LOGS_FILTER . DURATION ? 0 : - 1
55
54
56
55
const setUntilTimeOptionsWithExcluded = ( ) => {
57
56
const nearestOption = getNearestTimeOptionBeforeNow ( )
@@ -96,8 +95,8 @@ export const InputForSelectedOption = ({
96
95
let errorString
97
96
if ( e . target . value === '' ) {
98
97
errorString = 'This field is required'
99
- } else if ( e . target . value === '0' ) {
100
- errorString = 'Value cannot be 0'
98
+ } else if ( Number ( e . target . value ) < 0 ) {
99
+ errorString = 'Value must be greater than 0'
101
100
} else if ( customLogFilterOptions [ filterTypeRadio ] . error ) {
102
101
errorString = ''
103
102
}
@@ -109,10 +108,9 @@ export const InputForSelectedOption = ({
109
108
110
109
const handleInputChange = ( e ) => {
111
110
checkInputError ( e )
112
- const val = Number ( e . target . value ) < minValue ? minValue . toString ( ) : e . target . value
113
111
setCustomLogFilterOptions ( ( prevState ) => ( {
114
112
...prevState ,
115
- [ filterTypeRadio ] : { ...prevState [ filterTypeRadio ] , value : val } ,
113
+ [ filterTypeRadio ] : { ...prevState [ filterTypeRadio ] , value : e . target . value } ,
116
114
} ) )
117
115
}
118
116
@@ -138,7 +136,7 @@ export const InputForSelectedOption = ({
138
136
< input
139
137
type = "number"
140
138
autoComplete = "off"
141
- min = { minValue }
139
+ min = { 1 }
142
140
className = "input-focus-none"
143
141
value = { customLogFilterOptions [ filterTypeRadio ] . value }
144
142
onChange = { handleInputChange }
0 commit comments