chore: Updating the dropdown width for the run behavior settings of JS object (#40691)

## Description

Updating the dropdown width for the run behavior settings of JS object

Fixes [#40657](https://github.com/appsmithorg/appsmith/issues/40657)

## Automation

/ok-to-test tags="@tag.JS, @tag.IDE"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/15113084468>
> Commit: 8b29ef23202e1ae2c1c0c05012ee2f94ec6a85d2
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=15113084468&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JS, @tag.IDE`
> Spec:
> <hr>Mon, 19 May 2025 13:26:04 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added an option to control whether the dropdown menu width matches the
select input width, or to set a custom width for dropdown menus.

- **Style**
  - Improved popover content width handling for more consistent display.
- Adjusted minimum width of select input in function settings for a more
compact appearance.
- Dropdown menus in function settings now have a fixed width for better
usability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ankita Kinger 2025-05-19 19:33:27 +05:30 committed by GitHub
parent bddf6063e2
commit 8c84ac3dc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 3 deletions

View File

@ -26,6 +26,7 @@ function Select(props: SelectProps) {
children, children,
className, className,
dropdownClassName, dropdownClassName,
dropdownMatchSelectWidth = true,
isDisabled = false, isDisabled = false,
isLoading = false, isLoading = false,
isMultiSelect, isMultiSelect,
@ -88,6 +89,7 @@ function Select(props: SelectProps) {
SelectDropdownClassName + `--${size}`, SelectDropdownClassName + `--${size}`,
dropdownClassName, dropdownClassName,
)} )}
dropdownMatchSelectWidth={dropdownMatchSelectWidth}
dropdownRender={(menu: any) => { dropdownRender={(menu: any) => {
return ( return (
<div> <div>

View File

@ -11,6 +11,7 @@ export type SelectProps = RCSelectProps & {
isDisabled?: boolean; isDisabled?: boolean;
isValid?: boolean; isValid?: boolean;
isLoading?: boolean; isLoading?: boolean;
dropdownMatchSelectWidth?: boolean | number;
}; };
export type SelectOptionProps = OptionProps & { export type SelectOptionProps = OptionProps & {

View File

@ -24,8 +24,9 @@ const StyledPopoverHeader = styled(PopoverHeader)`
`; `;
const StyledPopoverContent = styled(PopoverContent)<{ popoverWidth?: string }>` const StyledPopoverContent = styled(PopoverContent)<{ popoverWidth?: string }>`
--popover-width: ${({ popoverWidth }) => min-width: 280px;
popoverWidth ? popoverWidth : "280px"}; max-width: ${({ popoverWidth }) => (popoverWidth ? popoverWidth : "280px")};
width: fit-content;
`; `;
export const ToolbarSettingsPopover = (props: Props) => { export const ToolbarSettingsPopover = (props: Props) => {

View File

@ -38,7 +38,7 @@ const StyledSelect = styled(Select)`
width: fit-content; width: fit-content;
.rc-select-selector { .rc-select-selector {
min-width: 120px; min-width: 110px;
} }
`; `;
@ -100,6 +100,7 @@ const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
</FunctionName> </FunctionName>
<StyledSelect <StyledSelect
data-testid={`t--dropdown-runBehaviour`} data-testid={`t--dropdown-runBehaviour`}
dropdownMatchSelectWidth={256}
id={props.action.id} id={props.action.id}
isDisabled={props.disabled} isDisabled={props.disabled}
listHeight={240} listHeight={240}