Skip to content

Commit

Permalink
#2460 ketcher-react input ui component map condition for slider fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii Vasilev committed Apr 24, 2023
1 parent a6960cc commit 4f41838
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/ketcher-react/src/script/ui/component/form/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ function ctrlMap(component, props: Props) {

function componentMap(props: Props) {
const { schema, type, multiple } = props

if (schema?.type === 'boolean' && schema?.description === 'slider') {
return Slider
}

if (!schema || (!schema.enum && !schema.items && !Array.isArray(schema))) {
if (type === 'checkbox' || (schema && schema.type === 'boolean')) {
return CheckBox
Expand All @@ -322,10 +327,6 @@ function componentMap(props: Props) {
return type === 'textarea' ? TextArea : GenericInput
}

if (schema?.type === 'boolean' && schema?.description === 'slider') {
return Slider
}

if (multiple || schema.type === 'array')
return type === 'checkbox' ? FieldSet : Select

Expand Down

0 comments on commit 4f41838

Please sign in to comment.