function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ajinkya Deshmukh 16Ajinkya Deshmukh 16 

force:inputfield is not displayed on the modal popup

I have created modal in component and added <force:inputField inside it, but it is not displayed on the modal popup.

But, if the same <force:inputField is added in the component, then it displayed on the component.

User-added image
 
<aura:attribute name="contactOnAccount" type="Custom_Opportunity_Contact_Role__c" 
               default="{ 'sobjectType': 'Custom_Opportunity_Contact_Role__c' }"/>

<aura:if isTrue="{!v.editOCRModal}">
        <div aura:id="new-ocr" class="" style="">
            <div role="dialog" tabindex="-1"  class="slds-modal slds-fade-in-open">
                <div class="slds-modal__container main-modal-container slds-modal slds-fade-in-open">
                    <div class="slds-modal__header">
                        <div aura:id="new_ocr_setting_modal" class="slds-text-heading--small modal-header">New Priority Points Settings</div>
                        <div class="close_modal"> 
                            <lightning:buttonIcon iconName="utility:close" alternativeText="Close" iconClass="light" size="x-small" class="add_ocr" onclick="{!c.closeModal}" />
                        </div>
                    </div>
                    <div class="slds-modal__content slds-p-around--medium content">
                        <label class="slds-custom-label">Contact</label> 

                        <force:inputField aura:id="test_lookup_field" value="{!v.contactOnAccount.Contact__c}"/>

                    </div>
                </div>
            </div>
            <div class="slds-backdrop slds-backdrop_open"></div>
        </div>
    </aura:if>

How to diaplay force:inputfield on the modal popup?
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ajinkya,

Greetings to you!

I tried to research your problem and found that this is a known issue.

https://success.salesforce.com/issues_view?id=a1p3A0000008gLZQAY

https://success.salesforce.com/ideaView?id=0873A000000E4G3QAK

It will only work if it is directly under the aura:component tag. For workaround please refer to below links:

https://salesforce.stackexchange.com/questions/153182/forceinputfield-is-not-working-in-lightning-experience

https://salesforce.stackexchange.com/questions/139668/unable-to-get-forceinputfield-or-forceoutputfield-to-render-inside-other-marku

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Miles Smith 5Miles Smith 5
for me, this thread solution worked https://salesforce.stackexchange.com/questions/164931/is-there-a-way-to-call-javascript-after-action-on-visualforce-page (http://for me, this thread solution worked https://salesforce.stackexchange.com/questions/164931/is-there-a-way-to-call-javascript-after-action-on-visualforce-page with regards)
with regards
https://kodi.software/download/  (https://kodi.software/download/https://viamichelin.onl/     https://viamichelin.onl/