You need to sign in to do that
Don't have an account?
Yuvaraj Palani
LWC - Need help on changing <lightning-combox> dropdown size
Hello,
I'm using Lighting combox on LWC modal and the picklist values are going away from the modal.
I want to restrict the Dropdown size according to the modal content component.
when I inspect this component in this browser, I could see it defaults to size 10 using the slds class .slds-dropdown_length-with-icon-10
I tried to override this slds class in my component, but it didn't work due to shallow DOM restriction.
If I could atleast change the dropdown size to "5", that should be ok for now.
If anyone has any ideas , please let me know.
I'm using Lighting combox on LWC modal and the picklist values are going away from the modal.
I want to restrict the Dropdown size according to the modal content component.
<lightning-combobox name="Month" label="Month" data-attribute="month" class="dropdownsize validValue" value={cardDetails.expiryMonth} placeholder="Month" options={Months} dropdown-alignment="bottom-left" required></lightning-combobox>
when I inspect this component in this browser, I could see it defaults to size 10 using the slds class .slds-dropdown_length-with-icon-10
I tried to override this slds class in my component, but it didn't work due to shallow DOM restriction.
If I could atleast change the dropdown size to "5", that should be ok for now.
If anyone has any ideas , please let me know.
You cannot override th shadow DOM elements in LWC, try using HTML Select for the dropdown here.