Skip to content

Commit

Permalink
fix(admin-ui): boolean and string undefined fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Jan 12, 2023
1 parent 3562826 commit c4df14b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions admin-ui/app/routes/Apps/Gluu/GluuInlineInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ function GluuInlineInput({
const [show, setShow] = useState(false)
const [correctValue, setCorrectValue] = useState([])
const [data, setData] = useState(value)
const onValueChanged = () => {
const onValueChanged = (e) => {
if(isBoolean){
setData(e.target.checked)
}else{
setData(e.target.value)
}
setShow(true)
}
const handleTypeAheadChange = (selectedOptions) => {
Expand All @@ -54,12 +59,11 @@ function GluuInlineInput({
if (isArray) {
patch[VALUE] = correctValue
} else {
patch[VALUE] = document.getElementById(name).value
patch[VALUE] = data
}
patch['op'] = 'replace'
handler(patch)
setShow(!show)
setData(document.getElementById(name).value)
}
const onCancel = () => {
setCorrectValue([])
Expand Down Expand Up @@ -93,7 +97,7 @@ function GluuInlineInput({
id={name}
data-testid={name}
name={name}
onChange={onValueChanged}
handler={onValueChanged}
value={value}
/>
)}
Expand Down

0 comments on commit c4df14b

Please sign in to comment.