Skip to content

Commit

Permalink
#391 update rendering of SelectCheckbox component (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMazol authored Mar 15, 2021
1 parent 5d24ac2 commit 49c24d9
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ import React from 'react'
import Input from './input'

function SelectCheckbox({ schema, ...props }) {
const desc = {
title: schema.title,
enum: [true, false],
enumNames: ['on', 'off']
let currentSchema = schema
if (schema.type === 'boolean') {
currentSchema = {
title: schema.title,
enum: [true, false],
enumNames: ['on', 'off'],
default: schema.default
}
}
return <Input schema={desc} {...props} />

return <Input schema={currentSchema} {...props} />
}

export default SelectCheckbox

0 comments on commit 49c24d9

Please sign in to comment.