Skip to content

Commit c4df14b

Browse files
committed
fix(admin-ui): boolean and string undefined fix
1 parent 3562826 commit c4df14b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

admin-ui/app/routes/Apps/Gluu/GluuInlineInput.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ function GluuInlineInput({
3535
const [show, setShow] = useState(false)
3636
const [correctValue, setCorrectValue] = useState([])
3737
const [data, setData] = useState(value)
38-
const onValueChanged = () => {
38+
const onValueChanged = (e) => {
39+
if(isBoolean){
40+
setData(e.target.checked)
41+
}else{
42+
setData(e.target.value)
43+
}
3944
setShow(true)
4045
}
4146
const handleTypeAheadChange = (selectedOptions) => {
@@ -54,12 +59,11 @@ function GluuInlineInput({
5459
if (isArray) {
5560
patch[VALUE] = correctValue
5661
} else {
57-
patch[VALUE] = document.getElementById(name).value
62+
patch[VALUE] = data
5863
}
5964
patch['op'] = 'replace'
6065
handler(patch)
6166
setShow(!show)
62-
setData(document.getElementById(name).value)
6367
}
6468
const onCancel = () => {
6569
setCorrectValue([])
@@ -93,7 +97,7 @@ function GluuInlineInput({
9397
id={name}
9498
data-testid={name}
9599
name={name}
96-
onChange={onValueChanged}
100+
handler={onValueChanged}
97101
value={value}
98102
/>
99103
)}

0 commit comments

Comments
 (0)