I'm trying to understand how to add custom error messaging to the lightning:select base component.
I understand that I can use the validity object to check if there is bad data and set a respective custom message. What I am having trouble understanding is how to apply it to this scenario:
- I have a lightning:select component defined with the values "Red,Blue,Green".
- Because I want to force a selection, I've added "-- None --" as the first value in the list.
- So I have "-- None --,Red,Blue,Green"
How do I tell the base component that "-- None --" is invalid and an error needs to be shown?
Thanks!