From b3121fae223c8c343f0660b8700a45e5ecfa21d2 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Tue, 7 Jul 2020 22:00:58 -0700 Subject: [PATCH] remove px from width string and then parse (#11241) --- extensions/resource-deployment/src/ui/modelViewUtils.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/extensions/resource-deployment/src/ui/modelViewUtils.ts b/extensions/resource-deployment/src/ui/modelViewUtils.ts index 4acbe747a2..35af2b670d 100644 --- a/extensions/resource-deployment/src/ui/modelViewUtils.ts +++ b/extensions/resource-deployment/src/ui/modelViewUtils.ts @@ -608,11 +608,7 @@ function processCheckboxField(context: FieldContext): void { * @param context The context to use to create the field */ function processFilePickerField(context: FieldContext): FilePickerInputs { - const inputWidth = parseInt(context.fieldInfo.inputWidth!); - if (inputWidth === NaN) { - // this is a dev time only error - throw new Error('Unable to parse the input width of the file picker field'); - } + const inputWidth = parseInt(context.fieldInfo.inputWidth!.replace(/px/g, '').trim()); const buttonWidth = 100; const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, cssStyles: context.fieldInfo.labelCSSStyles });