Skip to content

[WC-3355]: fix combobox not updating displayed value on external attribute change#2173

Open
rahmanunver wants to merge 1 commit intomainfrom
fix/wc-3355_combobox-value-update
Open

[WC-3355]: fix combobox not updating displayed value on external attribute change#2173
rahmanunver wants to merge 1 commit intomainfrom
fix/wc-3355_combobox-value-update

Conversation

@rahmanunver
Copy link
Copy Markdown
Contributor

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

In database mode, the combobox displayed a stale value when the target attribute was changed externally (e.g. by a popup combobox writing to the same attribute).

Root cause: DatabaseSingleSelectionSelector.updateProps() only synced currentId on initial load (!this.currentId). When the attribute changed from value A to value B while currentId was already set to A, the condition was false so currentId stayed at A and the display never updated.

Fix: Added a second condition — also enter the sync branch when the current option's stored value no longer matches the incoming targetAttribute.value, using the existing _valuesIsEqual helper for type-safe comparison. A matching value short-circuits the scan, so there is no performance impact on the common (no-change) case.

Files changed:

  • src/helpers/Database/DatabaseSingleSelectionSelector.ts — core fix (one condition added)
  • CHANGELOG.md### Fixed entry under ## [Unreleased]
  • package.json + src/package.xml — version bump 2.8.0 → 2.8.1
  • AGENTS.md — architecture reference for future debugging sessions

What should be covered while testing?

  1. Open a page with two comboboxes in database mode bound to the same attribute on the same object.
  2. Select a value in combobox A (e.g. "Option 1").
  3. Open a popup that contains combobox B; select a different value (e.g. "Option 2") and close the popup.
  4. Expected: Combobox A now displays "Option 2".
  5. Before fix: Combobox A still shows "Option 1" (stale).
  6. Verify the reverse direction: change in A after changing via B also works correctly.

@rahmanunver rahmanunver requested a review from a team as a code owner April 13, 2026 14:23
…es externally in database mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rahmanunver rahmanunver force-pushed the fix/wc-3355_combobox-value-update branch from 368511d to 1b2d1c5 Compare April 13, 2026 14:23
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="Combobox" version="2.8.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="Combobox" version="2.8.1" xmlns="http://www.mendix.com/clientModule/1.0/">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We bump versions in release preparation step nowadays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants