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

Please sign in to leave a comment.