Problems unsing multiple empty image blocks
-
Hello,
I am working on a plugin that selects a specific attachment in a media frame. I encountered some problems using multiple empty blocks in one post.
If I am on a post and I create a block e.g. ?image“ and choose ?Media Library“ to pick an attachment the media frame opens.
Then I select an attachment using: ?wp.media.frame.state().get(‘selection’).add(wp.media.attachment(5))“ and everything works as expected.
The problem: If I place multiple empty blocks and choose ?Media Library“ from a block that is above another empty block I get an error that the state is undefined.
Why is that happening and how could I fix this?
A short screen capture for better understanding: https://streamable.com/c4xuw5
- The topic ‘Problems unsing multiple empty image blocks’ is closed to new replies.