You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes the Checkbox, Dropdown and Select list when the models change the UI updates. (#19487)
* Fix CheckboxList UI not updating when values are set programmatically
* WIP
* Added unit tests for the new functionality in the checkbox list element.
As requested by Copilot, here are some unit tests to ensure this addition passes all of the possible edge cases mentioned.
* Small change based on CoPilot feedback
Removed a check that was redundant and removed a unit test that was also not needed for the current PR and fixed one of the other tests.
* Fixing code quality issues highlighted in the unit tests
* Fix CheckboxList UI not updating when values are set programmatically
* WIP
* Standardizes property editor UI state management
Introduces a utility for managing the state of property editor UI elements
when their values are set programmatically.
This ensures that UI components like dropdowns, checkbox lists, and selects
correctly reflect the selected values, especially when these values are
updated via code rather than direct user interaction.
The changes include:
- A mixin to simplify state updates
- A helper function to ensure values are handled as arrays
- Consistent state updating logic across components.
* Update src/Umbraco.Web.UI.Client/src/packages/property-editors/select/property-editor-ui-select.element.ts
Co-authored-by: Copilot <[email protected]>
* Removed the hard coded label
* Fixed the short-circuit issue raised by co-pilot
* Fixing more co-pilot suggestions
Also cleaned up the test files based on the JSDocs suggestions.
* Update src/Umbraco.Web.UI.Client/src/packages/property-editors/dropdown/property-editor-ui-dropdown.element.ts
Co-authored-by: Copilot <[email protected]>
* Refactors checkbox and dropdown tests
Refactors checkbox-list and dropdown property editor UI tests to share common test utilities, reducing code duplication and improving maintainability.
Uses Sets for faster selection lookup in `updateItemsState` function.
* Fixing CodeScene suggestion based on "String Heavy Function Arguments"
* Fix for an issue that was stopping the Bellissima build.
* Improves property editor UI state updates
Ensures UI updates in checkbox list, dropdown and select property editors only occur when necessary.
Avoids unnecessary re-renders by comparing the updated state with the current state, and only triggering an update if there are actual changes.
This improves performance and prevents potential issues caused by excessive re-rendering.
* Changes based on feedback from @nielslyngsoe
* removing unnecessary call to requestUpdate
---------
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Niels Lyngsø <[email protected]>
Co-authored-by: Niels Lyngsø <[email protected]>
Copy file name to clipboardExpand all lines: src/Umbraco.Web.UI.Client/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.element.ts
Copy file name to clipboardExpand all lines: src/Umbraco.Web.UI.Client/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.test.ts
0 commit comments