0

I have a requirement to open a Model box from a visualforce tab in the lighting console app. My model is stuck inside the console tab and not opening in the full window.

below is the code that I used for the model and I am opening this popup inside visualforce page

<template>
<template if:true={showPopup}>
    <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_small"
        aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1">
        <div class="slds-modal__container">
            <header class="slds-modal__header" style="padding-bottom: 0;">
                //code for header
            </header>
            <div class="slds-modal__content slds-var-p-around_medium" id="modal-content-id-1">
                <div class="slds-box">
                    <lightning-formatted-rich-text value={modelContent.content}></lightning-formatted-rich-text>
                </div>
            </div>
        </div>
    </section>
    <div class="slds-backdrop slds-backdrop_open" onmousedown={closeModel}></div>
</template>

Actual Output:

enter image description here

Expected Output: enter image description here

2
  • Which modal code did you use? Using this still works fine sfdcpoint.com/salesforce/…. I remember there was an update regarding this. But I think it apples only if you using overlay library, i guess. Commented Dec 22, 2020 at 10:33
  • @NagendraSingh, I have updated my code for model Commented Dec 22, 2020 at 10:56

1 Answer 1

0

So as per my understanding, your VFPage might be inside an iframe as it is in Lightning console.

As the component is getting created in an iframe it might open on full screen.

To open on full screen, have a utility bar and add an LWC component wrapped inside an aura component in that, add a listener here (LMS or message event). From VF Page just post a message event to LWC component with all required attributes and open the modal from LWC. Then it should open on full page.

2
  • Thank you for the solution, I have tried this before posting it, but for the popup, we don't want to add a utility bar for all the customers. so I was wondering if there is any other solution to how the popup out of the iframe. Commented Dec 23, 2020 at 3:18
  • There is another solution, you can have a hidden LWC component in page itself disgused as a listener, same as utility bar, the only extra thing there would be, you will have to make sure when the message is triggered only the current tab listens to it by passing some parameter, like tab id. Commented Dec 23, 2020 at 3:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .