In Developerforce Written by

How to add Salesforce1 Dropdown (Picklist) Style for Lightning Component

If you are working on Salesforce1 Lightning Component and have a picklist (or Dropdown) in your component then you will notice that the picklist style is different than default SF1 Mobile style for picklist like below:

Dropdown style issue SF1 Mobile

The solution to make picklist style look like SF1 Mobile default, you would need to update the CSS Style for your component in Developer Console and Add the following Class.

SF1 Picklist Style for LC

Here is the Code for the CSS Style Class:

 

.THIS .sf1select {
 -webkit-appearance: none;
 border: 1px solid #bbc0c4;
 background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImRvd25fMV8iIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgNjQgNjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDY0IDY0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnIGlkPSJEb3duX3g0MF8yeC5wbmdfMV8iPg0KCTxnIGlkPSJkaXJlY3Rkb3duX2NvcHkiPg0KCQk8Zz4NCgkJCTxwYXRoIGZpbGw9IiM5Njk4OTkiIGQ9Ik01NS4wNjYsMTcuODY2Yy0wLjUz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0xMC4zOTksMC0yMC40LDAuNi0yMC41MzMsMC42NjdjLTEuMDY2LDAuMDY2LTIuMDY2LDAuNjY2LTIuNTMzLDEuNmMtMC41MzMsMC45MzQtMC41MzMsMi4wNjYsMCwzDQoJCQkJYzcuOTMzLDE0LjA2NiwyMC40LDI2LjI2NywyMC45MzMsMjYuNzMyYzEuMiwxLjA2NiwzLjA2NiwxLjA2Niw0LjI2NywwYzAuNTMzLTAuNDY3LDEzLTEyLjY2NiwyMC45MzMtMjYuNzMyDQoJCQkJQzU1LjYsMTkuOTMzLDU1LjYsMTguOCw1NS4wNjYsMTcuODY2eiIvPg0KCQk8L2c+DQoJPC9nPg0KPC9nPg0KPC9zdmc+DQo=),linear-gradient(#ffffff,#f1f1f1);
 background-repeat: no-repeat;
 background-position: 95% 50%;
 background-size: 16px 16px,100% 100%;
 color: #3c3d3e;
 line-height: 25px;
 font-family: 'ProximaNovaSoft-Regular', 'Helvetica Neue';
 font-size: 15px;
 width: 100%;
 padding: 7px 14px;
 border: 1px solid #cfd0d2;
 border-radius: 5px;
 }

 

The final results for me look like the following similar to SF1 Mobile Style:


Dropdown style solution SF1

Hope That Help!

Share your tips for lightning component below in the comments…

 

(Visited 53 times, 1 visits today)
Sign up for our weekly tips, skills, gear and interestng newsletters.

Last modified: February 28, 2023

Comments are closed.