Skip to content

Commit

Permalink
fix(Designer): Only show dropdown for array editor when there are opt…
Browse files Browse the repository at this point in the history
…ions (#4783)

change\
  • Loading branch information
Eric-B-Wu committed May 6, 2024
1 parent 453acae commit 01d4e87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Expand Up @@ -128,10 +128,14 @@ export const TokenField = ({
onChange={onValueChange}
dataAutomationId={`msla-setting-token-editor-arrayeditor-${labelForAutomationId}`}
// Props for dynamic options
options={dropdownOptions?.map((option: any, index: number) => ({
key: index.toString(),
...option,
}))}
options={
dropdownOptions.length > 0
? dropdownOptions.map((option: any, index: number) => ({
key: index.toString(),
...option,
}))
: undefined
}
isLoading={isLoading}
errorDetails={errorDetails}
onMenuOpen={onComboboxMenuOpen}
Expand Down
7 changes: 0 additions & 7 deletions libs/designer-ui/src/lib/tokenpicker/index.tsx
Expand Up @@ -148,14 +148,7 @@ export function TokenPicker({
description: 'Placeholder text to search token picker',
});

const topCalloutStyle = windowDimensions.height / 5.25;

const calloutStyles: Partial<ICalloutContentStyles> = {
root: {
position: 'fixed',
top: `${topCalloutStyle}px !important`,
maxHeight: '470px !important',
},
calloutMain: {
overflow: 'visible',
},
Expand Down
Expand Up @@ -66,7 +66,7 @@ export const TokenPickerSection = ({
style={{
maxHeight: fullScreen
? windowDimensions.height - (expressionEditorCurrentHeight + 287)
: Math.min(windowDimensions.height - (expressionEditorCurrentHeight + 197), 180),
: Math.min(windowDimensions.height - (expressionEditorCurrentHeight + 197), 540),
}}
>
{searchQuery && noItems ? <TokenPickerNoMatches /> : null}
Expand Down

0 comments on commit 01d4e87

Please sign in to comment.