Skip to content

Conversation

@yauheni-formio
Copy link

Description

the problem arose because of the wrapper this._store.withTxn(function () {}). I compared the working version of 10 choices and 11 (with this bug) and here is the problem. See the screenshots below.
image
When we click on the 'X' to remove the "Second" tag, we get, for version 11 (with bug):
image
As you can see, after deleting item, the passedElement.value field does not change its value (second is not deleted)

Compare this to working version 10:
image
As you see after removal "second" passedElement.value changed and contains only "first" value.

Types of changes

  • Chore (tooling change or documentation change)
  • Refactor (non-breaking change which maintains existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • I have added new tests for the bug I fixed/the new feature I added.
  • I have modified existing tests for the bug I fixed/the new feature I added.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@yauheni-formio yauheni-formio force-pushed the Update-passedElement.value-after-removing-item branch from a830b8e to 59e8e4f Compare July 1, 2025 15:06
@Xon Xon added bugfix Pull request that fixes an existing bug changes required Pull request requires changes before it can be merged labels Jul 9, 2025
@Xon Xon self-assigned this Jul 9, 2025
@Xon Xon self-requested a review July 9, 2025 13:04
@Xon Xon removed their assignment Jul 9, 2025
Copy link
Collaborator

@Xon Xon left a comment

Choose a reason for hiding this comment

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

This change doesn't look to work with select backed fields. The root-cause is this._store.withTxn is deferring the backing element update to after the method finishes, but the events are raised inside the method.

The correct solution would be to move the events to after the withTxn() method call. There looks to be a bunch of locations which need to be updated

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

Labels

bugfix Pull request that fixes an existing bug changes required Pull request requires changes before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants