This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

React | Media Library Widget not using config when starting with openMediaLibrary

Comments

3 comments

  • Avatar
    Eric Pasos

    Hi Stefan,

    I have provided some answers to the internal ticket you've created. And to provide the information here, when attaching the Media Library Widget to a div element, the id parameter is linked with the inline_container parameter of the cloudinary.openMediaLibrary:

    mediaLibrary.current = (window as any).cloudinary.openMediaLibrary(
    {
    ...config,
    inline_container:'#widget-container',
    },
    {
    insertHandler: (data: any) => {
    console.log('REACT insertHandler App.tsx', data)
    },
    showHandler: () => {
    console.log("show")
    },
    hideHandler: () => {
    console.log("hide")
    }
    },
    )
     
    For the div element:
    <div id="widget-container" ref={setRef} style={{ height: '45vh', paddingBottom: '5vh' }}></div>
    Hope this helps.
    1
    Comment actions Permalink
  • Avatar
    Stefan

    Hi Eric,

    as I said in the internal ticket, thanks for your quick help and it works as you suggested. Now I only need to find out how to solve the other issue I posted about "Media Library has no close event".

    0
    Comment actions Permalink
  • Avatar
    Eric Pasos

    Hi Stefan,

    You're welcome! I will provide the answers to the other ticket thread.

    0
    Comment actions Permalink

Post is closed for comments.