Skip to content

[8.2-stable] fix(RemoteSelect): Persist selection on change#3901

Merged
tvdeyen merged 1 commit into
8.2-stablefrom
backport/8.2-stable/pr-3900
May 19, 2026
Merged

[8.2-stable] fix(RemoteSelect): Persist selection on change#3901
tvdeyen merged 1 commit into
8.2-stablefrom
backport/8.2-stable/pr-3900

Conversation

@alchemycms-ci-bot
Copy link
Copy Markdown
Collaborator

Backport

This will backport the following commits from main to 8.2-stable:

Questions ?

Please refer to the Backport tool documentation

The select2 component initializes its selection from the `selection`
attribute via `initSelection`. When the component is disconnected and
reconnected (for example after drag and drop reorders the surrounding
DOM), select2 is re-attached to the same input but the `selection`
attribute still reflects the original server-rendered value. The just
made user selection is lost.

Updating the `selection` attribute whenever a new item is added keeps
the attribute in sync with the current value so the selection survives
re-attaching the component.

(cherry picked from commit 314d20b)

# Conflicts:
#	app/assets/builds/alchemy/alchemy_admin.min.js
#	app/assets/builds/alchemy/alchemy_admin.min.js.map
@tvdeyen tvdeyen force-pushed the backport/8.2-stable/pr-3900 branch from c6fbed2 to a33ea14 Compare May 19, 2026 14:24
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.07%. Comparing base (a06a6c5) to head (a33ea14).
⚠️ Report is 1 commits behind head on 8.2-stable.

Additional details and impacted files
@@             Coverage Diff             @@
##           8.2-stable    #3901   +/-   ##
===========================================
  Coverage       98.07%   98.07%           
===========================================
  Files             322      322           
  Lines            8558     8558           
===========================================
  Hits             8393     8393           
  Misses            165      165           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen tvdeyen merged commit 0565970 into 8.2-stable May 19, 2026
24 checks passed
@tvdeyen tvdeyen deleted the backport/8.2-stable/pr-3900 branch May 19, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants