Fix the GoDAM Media Library breaking issues - #2048
Draft
KMchaudhary wants to merge 1 commit into
Draft
Conversation
Mount the folder sidebar into the opened frame's own menu (retrying until it renders) and hand React the exact root, instead of guessing the last visible frame. Bind mounting to the frame event so reused frames restore the sidebar on reopen. Gate the modal-close reset so it only runs once the last media modal closes, so a nested-modal close no longer wipes the active folder selection mid-use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the reliability and correctness of the media library sidebar integration, especially in environments where multiple media modals can be open (such as the WordPress block editor, classic editor, and Elementor). The changes ensure the sidebar is mounted and unmounted at the right times and that UI state is only reset when all media modals are closed, preventing accidental loss of user context.
Media frame sidebar mounting and lifecycle improvements:
Robust UI state reset handling for multiple/nested modals:
Code cleanup and variable renaming:
ELEMENTOR_MENU_*toMEDIA_FRAME_MENU_*to clarify that the logic applies to all media frames, not just Elementor. [1] [2]These changes significantly improve the sidebar's stability and user experience in complex modal scenarios.