You need to sign in to do that
Don't have an account?
Carly Probasco 14
How to make a picklist field read only in lighting component?
I have a picklist field that i would like to make read only on a edit screen.
<lightning:select name="classroomStatusSelect" label="Status:" value="{!v.SelectedClassroom.Status__c}" required="true" readonly="true"> <aura:iteration items="{!v.ClassroomStatusOptions}" var="classroomStatus"> <option text="{!classroomStatus}"></option> </aura:iteration> </lightning:select>What am i doing wrong?
I'm an admin wading in developer waters and fell back on configuration skills.
All Answers
Can you try checking the below link as the readonly attribute was not working and he tried disabled attribute, let me know if this helps and in case if this comes in handy can you please choose this as best answer so that it can be used by others in the future.
Link: https://salesforce.stackexchange.com/questions/156204/readonly-property-of-lightninginput-not-working
Regards,
Anutej
I checked and found out that a bug was already logged with Salesforce product team (W-4703044) in the past and they have specified this behavior as working as designed. However, seems like the documentation is yet to be updated to remove this field
Technical select does not have a read only attribute. The reason is that lists don't have values... they have selected options, which themselves have values
Using 'readonly' for the 'select' is not the valid use case. We can instead have an 'input' field if the value has to be read-only.
I tried disabled="true" and it disables the picklist field
I suggest logging a case with support. I will check on this internally from my end as well
Let me know if this helps
I'm an admin wading in developer waters and fell back on configuration skills.