humanmade / humanmade/asset-manager-framework
Currently selected featured image gets duplicated in amf generated media library
- Dominant language
- PHP
- Stars
- 188
- Forks
- 6
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 1
Description
I encountered an issue while trying to replace a featured image in WordPress. When I navigate to the media library generated by AMF, and select a new image, the current featured image gets added/duplicated to the AMF media library.
Steps to Reproduce:
1. Add a featured image to a post (it could be from the local library or the AMF-generated library).
2. Click on the "Replace" Featured Image button.
3. Navigate to the AMF-generated media library.
4. Select a new image from the library.
I am assuming this is related to Wordpress as I can see js events are generating the li item(currently selected featured image item) to the library are written in Wordpress.
Is there any way I can fix this?
I have tried resetting the current selection when the media dialog is opened, but it doesn't seem to work
```
wp.media.featuredImage.frame().on('open', function() {
const frame = wp.media.featuredImage.frame();
const selection = frame.state().get('selection');
selection.reset();
});
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.