From efa0018d46af1d31e0833bb9633db4cc42251bfe Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Mon, 6 Jan 2020 12:02:10 +0530 Subject: [PATCH] only set height when height is supplied --- .../editorComponents/DynamicAutocompleteInput.tsx | 6 ++++-- .../form/fields/KeyValueFieldArray.tsx | 12 ++---------- .../propertyControls/CodeEditorControl.tsx | 1 - .../components/propertyControls/InputTextControl.tsx | 1 - app/client/src/pages/Editor/APIEditor/Form.tsx | 3 +-- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx b/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx index 43cbc437c4..f69ad7aab2 100644 --- a/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx +++ b/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx @@ -129,7 +129,7 @@ interface ReduxStateProps { export type DynamicAutocompleteInputProps = { placeholder?: string; leftIcon?: Function; - initialHeight: number; + height?: number; theme?: THEME; meta?: Partial; showLineNumbers?: boolean; @@ -172,7 +172,9 @@ class DynamicAutocompleteInput extends Component { completeSingle: false, globalScope: this.props.dynamicData, }); - this.editor.setSize(0, this.props.initialHeight); + if (this.props.height) { + this.editor.setSize(0, this.props.height); + } this.editor.eachLine(this.highlightBindings); } } diff --git a/app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx b/app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx index 46e06c7cf1..4e41979792 100644 --- a/app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx +++ b/app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx @@ -32,16 +32,8 @@ const KeyValueRow = (props: Props & WrappedFieldArrayProps) => { {props.fields.map((field: any, index: number) => ( {index === 0 && {props.label}} - - + + {index === props.fields.length - 1 ? ( { ); diff --git a/app/client/src/components/propertyControls/InputTextControl.tsx b/app/client/src/components/propertyControls/InputTextControl.tsx index 748b39d6a3..6093bb2272 100644 --- a/app/client/src/components/propertyControls/InputTextControl.tsx +++ b/app/client/src/components/propertyControls/InputTextControl.tsx @@ -23,7 +23,6 @@ class InputTextControl extends BaseControl { touched: true, }} theme={"DARK"} - initialHeight={32} /> diff --git a/app/client/src/pages/Editor/APIEditor/Form.tsx b/app/client/src/pages/Editor/APIEditor/Form.tsx index 4b0ed1c5a3..3f2d738dd5 100644 --- a/app/client/src/pages/Editor/APIEditor/Form.tsx +++ b/app/client/src/pages/Editor/APIEditor/Form.tsx @@ -146,7 +146,6 @@ const ApiEditorForm: React.FC = (props: Props) => { placeholder="v1/method" name="actionConfiguration.path" leftIcon={FormIcons.SLASH_ICON} - initialHeight={32} /> @@ -166,7 +165,7 @@ const ApiEditorForm: React.FC = (props: Props) => {