From ffb845b5e07bce8752c732566f2b024a0ee62b09 Mon Sep 17 00:00:00 2001 From: gjulivan Date: Tue, 14 Jan 2025 15:18:20 +0100 Subject: [PATCH] fix: load initial data on database source --- packages/pluggableWidgets/combobox-web/CHANGELOG.md | 4 ++++ packages/pluggableWidgets/combobox-web/package.json | 2 +- .../src/helpers/BaseDatasourceOptionsProvider.ts | 9 +++++++++ .../helpers/Database/DatabaseSingleSelectionSelector.ts | 8 ++++++-- packages/pluggableWidgets/combobox-web/src/package.xml | 2 +- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/pluggableWidgets/combobox-web/CHANGELOG.md b/packages/pluggableWidgets/combobox-web/CHANGELOG.md index 88b470be7f..9104f042d7 100644 --- a/packages/pluggableWidgets/combobox-web/CHANGELOG.md +++ b/packages/pluggableWidgets/combobox-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- We fixed an issue where widget failed to show correct caption on initial load of database source. + ## [2.1.3] - 2024-12-11 ### Fixed diff --git a/packages/pluggableWidgets/combobox-web/package.json b/packages/pluggableWidgets/combobox-web/package.json index fe08692010..8258ce9cbc 100644 --- a/packages/pluggableWidgets/combobox-web/package.json +++ b/packages/pluggableWidgets/combobox-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/combobox-web", "widgetName": "Combobox", - "version": "2.1.3", + "version": "2.1.4", "description": "Configurable Combo box widget with suggestions and autocomplete.", "copyright": "© Mendix Technology BV 2024. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/combobox-web/src/helpers/BaseDatasourceOptionsProvider.ts b/packages/pluggableWidgets/combobox-web/src/helpers/BaseDatasourceOptionsProvider.ts index e5acba3067..1185385fa4 100644 --- a/packages/pluggableWidgets/combobox-web/src/helpers/BaseDatasourceOptionsProvider.ts +++ b/packages/pluggableWidgets/combobox-web/src/helpers/BaseDatasourceOptionsProvider.ts @@ -60,6 +60,15 @@ export class BaseDatasourceOptionsProvider extends BaseOptionsProvider { return _valuesIsEqual(targetAttribute.value, this.values.get(option)); }); if (obj) { this.currentId = obj; } else { + if (targetAttribute.value) { + this.options.loadSelectedValue(targetAttribute.value?.toString()); + this.lastSetValue = null; + } this.currentId = null; } } diff --git a/packages/pluggableWidgets/combobox-web/src/package.xml b/packages/pluggableWidgets/combobox-web/src/package.xml index 9ec2ce3a40..70c233a694 100644 --- a/packages/pluggableWidgets/combobox-web/src/package.xml +++ b/packages/pluggableWidgets/combobox-web/src/package.xml @@ -1,6 +1,6 @@ - +