Playlist block can't open the native media library
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, kotlin, swift, typescript
- Domain
- mobile-dev
Research direction
Start in useNativeMediaLibrary, where the openMediaLibrary bridge message is built, and trace how the multiple value from the Playlist block's edit.jsx (multiple="add" on MediaPlaceholder and MediaReplaceFlow) reaches it. Compare against the native decoders named in the issue — OpenMediaLibraryAction on iOS and parseMediaLibraryConfig on Android — which both expect a Boolean, and note the onSelect callback already treats multiple as truthy. Normalize multiple to a Boolean before sending; done means tapping "Media Library" and "Add track" opens the picker and the selected audio is added on both platforms.
Written by the indexing model from the issue text.
Description
Description
Choosing "Media Library" in a Playlist block should open the native media picker and add the selected audio to the playlist. Nothing happens instead, on both iOS and Android.
The Playlist block passes multiple="add" to MediaUpload. Upstream types this as boolean | 'add'. GutenbergKit forwards the string unchanged in the openMediaLibrary bridge message, but both native decoders expect a Boolean:
- iOS:
OpenMediaLibraryActionfails to decode. Before #917 this hit afatalErrorand crashed the app. Since #917 the message is logged and dropped. - Android:
parseMediaLibraryConfigthrows onrequireBoolean("multiple"), and the message is logged and dropped.
A likely fix is to normalize multiple to a Boolean in useNativeMediaLibrary before sending it, which covers both platforms. The onSelect callback already passes an array when multiple is truthy.
Step-by-step reproduction instructions
- Open the editor in a host app or the demo app.
- Insert a Playlist block.
- Tap "Media Library" in the placeholder, or "Add track" in the toolbar on an existing playlist.
- The media picker doesn't open. The native logs show a dropped
openMediaLibrarymessage.
Screenshots, screen recording, code snippet
// @wordpress/block-library/src/playlist/edit.jsx
<MediaPlaceholder multiple="add" … />
<MediaReplaceFlow multiple="add" … />
Environment info
GutenbergKit trunk (@wordpress/block-library 12.2.0). The crash was reported on the iOS app's 27.5 beta, before #917.
Please confirm that you have searched existing issues in the repo.
- Yes
- Dominant language
- JavaScript
- Stars
- 29
- Forks
- 6
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 76
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wordpress-mobile/GutenbergKit
-
[Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wordpress-mobile/GutenbergKit#884 ·
Maintainers usually reply within 1 day
-
[Type] Bug Android
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
wordpress-mobile/GutenbergKit#847 ·
Maintainers usually reply within 1 day
-
[Type] Bug iOS
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
wordpress-mobile/GutenbergKit#846 ·
Maintainers usually reply within 1 day
-
[Type] Bug [Type] Code Quality iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
wordpress-mobile/GutenbergKit#668 ·
Maintainers usually reply within 1 day
-
[Type] Bug [Type] Performance iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
wordpress-mobile/GutenbergKit#666 ·
Maintainers usually reply within 1 day
All issues in wordpress-mobile/GutenbergKit
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudflare/workers-sdk#17139 ·
Maintainers usually reply within 1 day
-
area: editor P3 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
halisonworks/mod-codeling#290 ·
Maintainers usually reply within 1 day
-
Teams conversion crashes on channel messages sent by an applicationPossibly taken @sdivyanshu90 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/aws-sdk-js-v3#8441 ·
Maintainers usually reply within 1 day