Custom UI in Header

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.4.7
Detailed description of issue
Hi,
We are trying to add custom elements using dev express controls like dropdown to the header section in the viewer. we were able to add ui control but the dropdown menu position is not with in the viewer iframe and its opening some where in the web application. is there any setting to bound in pdf express viewer?

Expected behaviour
NA

Does your issue happen with every document, or just one?
NA

Link to document

const renderbutton = () => {
    const divElement = document.createElement('div');
    divElement.id = 'searchDrpDwn';
    divElement.style = 'width:150px';
    let dropdownArray = allSearchTermsArray.map((s, i) => ({ elemId: s.elemId, description: s.description }));
    $(divElement).dxTagBox({
        dataSource: dropdownArray,
        placeholder: "select search",
        displayExpr: "description",
        valueExpr:'elemId',
        showSelectionControls: true,
        searchEnabled: true,
        maxDisplayedTags: 1,
        value: searchTermsArray.map(c => c.elemId),
        onValueChanged: function (data) {
            instance.docViewer.clearSearchResults();
            results = [];
            searchDropDownClick(data.value);
            instance.UI.openElements(['searchPanel']);
        }
    });
    return divElement;
}
async function searchDropDownClick(selectedIdLst) {
    for (var selectedElemId of selectedIdLst) {
        await performSearch(allSearchTermsArray.find(k => k.elemId == selectedElemId));
    }
}
const newCustomElement = {
    type: 'customElement',
    id: 'searchLst',
    render: renderbutton
};
instance.UI.setHeaderItems((header) => {
    let exiIndex = header.getItems().findIndex(item => item.id == 'searchLst');
    if (exiIndex > -1) {
        header.delete(exiIndex);
    }
    /*header.unshift(newCustomElement);    */
    header.push(newCustomElement);    
});

Code snippet
{Provide a relevant code snippet}

Hello prajneshu.khandavall,

Using the code provided I wasnt able to add it to a sample project and see the issue shown in the screenshot, could you provide a sample project clearly demonstrating the issue?

Best regards,
Tyler

Hi sorry for the late. i am attaching sample code in angularjs and modified the code.

please use this link to download the code https://drive.google.com/file/d/1lU6AOQOx042Dgpzz11rpacqQFr8GzMfD/view?usp=sharing

Hi @tgordon can you please help on this?

Hello prajneshu.khandavall,

Could you instead add it to a github repository? For security reasons I am unable to download for an untrusted drive link.
If you want to make a private repo, my github username is tyler-gordon

Best regards,
Tyler

Hey @tgordon thanks for letting know the issue. i created a github repository and added you. please let me if you are facing access issues

Hello prajneshu.khandavall,

Looks like the application does not run correctly, when downloading the repo then using a different PDF file (couldnt find it in the folders) I get these errors:

It looks like Jquery isnt installed in the repo

Best regards,
Tyler

@tgordon i included jquery and working in my local. may be issue with not mentioning mime types. just i added its type as "type=“application/javascript” in the script tag. please get latest and let me know if you still getting errors.
Thanks,
Prajneshu k

Hello prajneshu.khandavall,

Please push the appropriate changes to the repo!

Best regards,
Tyler

Hi @tgordon i pushed all changes to the main branch now. please try and let me know.

Hello prajneshu.khandavall,

The repo does not have the latest changes, the last commit was a month ago:

Best regards,
Tyler