0

I am creating a visualforce page using lightning design system style classes.The issue which I am facing is that I am using styleClass attribute in my two picklists shown using

These picklists are using dependencies. The Master picklist is appearing fine but the dependent picklist is not working fine with styles.

    <div class="slds-col slds-size--1-of-1 slds-medium-size--1-of-4 slds-small-size--1-of-2 slds-col--padded">
    <div class="slds-form-element">
        <label class="slds-form-element__label">Category</label>
        <div class="slds-form-element__control">
            <!-- <input class="slds-input" type="text" id="Part_Category"/> -->
            <apex:inputField value="{!objPart.Category1__c}" id="Part_Category" styleClass="picklist_style slds-input"/>
        </div>
    </div>
</div>

<div class="slds-col slds-size--1-of-1 slds-medium-size--1-of-4 slds-small-size--1-of-2 slds-col--padded">
    <div class="slds-form-element">
        <label class="slds-form-element__label">Family</label>
        <div class="slds-form-element__control">
            <!-- <input class="slds-input" type="text" id="Part_Family"/> -->
            <apex:inputField value="{!objPart.Family__c}" id="Part_Family" styleClass="picklist_style slds-input"/>
        </div>
    </div>
</div>





.picklist_style{
                width : 210px;
                height : 30px;

           }

enter image description here

4
  • Did you ever find a solution? Hitting the same problem myself.
    – Dan
    Aug 8, 2017 at 21:48
  • This is a tricky one because when Salesforce updates the DOM with new options it also drops all styles from the select.
    – dsharrison
    Aug 8, 2017 at 22:35
  • Yes @Dan, I changed the style classes for both of the picklists, and it indeed worked out. Aug 9, 2017 at 19:24
  • Changed the styleClass to slds-input and it worked Aug 10, 2017 at 12:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy