فهرست منبع

Fix options field rendering of empty 'enum' array

If the field is an enum with an empty array, don't render a dropdown
with an empty list, instead render a text input.
Sergiu Miclea 7 سال پیش
والد
کامیت
e92e5f2aec
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/components/molecules/WizardOptionsField/WizardOptionsField.jsx

+ 1 - 1
src/components/molecules/WizardOptionsField/WizardOptionsField.jsx

@@ -197,7 +197,7 @@ class WizardOptionsField extends React.Component<Props> {
         field = this.renderSwitch({ triState: true })
         break
       case 'string':
-        if (this.props.enum) {
+        if (this.props.enum && this.props.enum.length) {
           field = this.renderEnumDropdown()
         } else {
           field = this.renderTextInput()