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 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 class="slds-backdrop slds-backdrop_open"></div>

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.

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

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 (http://for me, this thread solution worked with regards)
with regards  (