PromucFlow_constructor/app/client/src/widgets
Rahul Barwal 8cbf8a5504
fix: Implement dynamic dropdown width in SelectField in JSONForm (#37289)
## Description
<ins>Problem</ins>

The SelectField inside JSONForm widget's dropdown width was not
dynamically adjusted, resulting in inconsistent responsiveness.

<ins>Root cause</ins>

The SelectField component's dropdown width was not being updated
dynamically, causing the component to become too wide or too narrow,
affecting its usability.

<ins>Solution</ins>

This PR enhances the SelectField component to adjust its dropdown width
dynamically for improved responsiveness. This PR handles...

- Dynamically adjusting the dropdown width based on the available screen
space, ensuring a responsive user experience.
- Properly setting up and tearing down the ResizeObserver to ensure
accurate width detection.

Fixes #37279
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.JSONForm"

### 🔍 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/11790765022>
> Commit: 1438c99fb6760f87879363ed1ad82bc0f3ddea54
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11790765022&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JSONForm`
> Spec:
> <hr>Tue, 12 Nov 2024 04:59:15 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**
- Enhanced the `SelectField` component for dynamic dropdown width
adjustment based on its wrapper size.
	- Improved filter update handling within the `SelectField`.

- **Bug Fixes**
- Expanded tests for validation logic to ensure accurate behavior based
on the `isRequired` property.

- **Tests**
- Added comprehensive tests for the `SelectField`, including mock
implementations for `ResizeObserver` to validate resizing behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-11-12 10:56:26 +05:30
..
AudioRecorderWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
AudioWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
BaseInputWidget feat: remove isFocus from meta state in InputWidgetV2 (#36843) 2024-10-16 16:01:07 +05:30
BaseWidgetHOC chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ButtonGroupWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
ButtonWidget chore: remove console errors on dev (#36639) 2024-10-15 00:23:51 +05:30
CameraWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
CategorySliderWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ChartWidget fix: Refactor handling of empty chart data in ChartWidget (#37009) 2024-10-23 14:03:46 +05:30
CheckboxGroupWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
CheckboxWidget chore: enable no-explicit-any rule (#35321) 2024-07-31 18:41:28 +03:00
CircularProgressWidget chore: Move widget deprecation messages from propertyPaneView to individual Widget configurations (#33759) 2024-06-04 11:55:55 +05:30
CodeScannerWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
components chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ContainerWidget chore: decouple widget-config.json from main chunk (#36924) 2024-10-17 20:48:39 +05:30
CurrencyInputWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
CustomWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
DatePickerWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
DatePickerWidget2 feat: Enhance date validation logic and add tests for timePrecision in DatePickerWidget2 (#37218) 2024-11-07 11:25:49 +05:30
DividerWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
DocumentViewerWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
DropdownWidget chore:delete unused files (#36368) 2024-09-19 16:01:03 +03:00
ExternalWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
FilepickerWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
FilePickerWidgetV2 chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
FormButtonWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
FormWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
IconButtonWidget chore: remove console errors on dev (#36639) 2024-10-15 00:23:51 +05:30
IconWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
IframeWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ImageWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
InputWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
InputWidgetV2 feat: remove isFocus from meta state in InputWidgetV2 (#36843) 2024-10-16 16:01:07 +05:30
JSONFormWidget fix: Implement dynamic dropdown width in SelectField in JSONForm (#37289) 2024-11-12 10:56:26 +05:30
ListWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ListWidgetV2 chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MapChartWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MapWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MenuButtonWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ModalWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MultiSelectTreeWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MultiSelectWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
MultiSelectWidgetV2 chore: removed old flags for airgap instances (#36609) 2024-10-07 15:26:25 +05:30
NumberSliderWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
PhoneInputWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ProgressBarWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
ProgressWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
RadioGroupWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
RangeSliderWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
RateWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
RichTextEditorWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
SelectWidget chore: removed old flags for airgap instances (#36609) 2024-10-07 15:26:25 +05:30
SingleSelectTreeWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
StatboxWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
SwitchGroupWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
SwitchWidget chore: delete unused code (#36461) 2024-09-23 13:52:00 +03:00
TableWidget chore:delete unused files (#36368) 2024-09-19 16:01:03 +03:00
TableWidgetV2 fix: Enhance URL handling in table by rendering URL column types with <a> tag. (#37179) 2024-11-06 10:27:57 +05:30
TabsMigrator chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
TabsWidget chore: decouple widget-config.json from main chunk (#36924) 2024-10-17 20:48:39 +05:30
TextWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
VideoWidget chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
BaseComponent.tsx
BaseWidget.tsx chore: chore: add SVGR to appsmith-icon package, add processing for custom icons, update date-fns (#37115) 2024-10-28 14:55:42 +03:00
CanvasWidget.tsx chore: enable no-explicit-any rule (#35321) 2024-07-31 18:41:28 +03:00
ConnectDataOverlay.tsx chore: rename ADS package (#35583) 2024-08-09 17:20:29 +03:00
index.ts chore: move chat widget to EE repo (#36845) 2024-10-14 13:10:28 +03:00
MetaHOC.tsx chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
MetaWidgetContextProvider.tsx chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
Skeleton.tsx
SkeletonWidget.tsx feat: implement dropping building blocks on canvas (#31857) 2024-04-16 09:41:09 +01:00
useDropdown.tsx chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
utils.test.ts
utils.ts
WidgetUtils.test.ts chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00
WidgetUtils.ts chore: remove console errors on dev (#36639) 2024-10-15 00:23:51 +05:30
withLazyRender.tsx chore: enable no-explicit-any rule (#35321) 2024-07-31 18:41:28 +03:00
withWidgetProps.tsx chore: add blank line eslint rule (#36369) 2024-09-18 19:35:28 +03:00