Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix media image select #4828

Merged
merged 2 commits into from
Dec 29, 2024
Merged

Fix media image select #4828

merged 2 commits into from
Dec 29, 2024

Conversation

myovchev
Copy link
Contributor

Summary

Fixes a regression, where images in Media manager are not selectable (click on an image does nothing) in both default and relationship mode.

The source of the problem is a :key prop that is randomized on click, probably due to an immediate (outside) re-rendering of the component. The provided solution: memoize media item keys so that the "key" is attached to an image item just once.

What are the specific steps to test this change?

Selecting an image in Media Manager works as expected.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@myovchev myovchev requested a review from boutell December 29, 2024 13:51
@boutell boutell merged commit c1acb30 into main Dec 29, 2024
9 checks passed
@boutell boutell deleted the hotfix-media-select branch December 29, 2024 21:30
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