-
Notifications
You must be signed in to change notification settings - Fork 315
Description
Hello.
Today playing with carbon i've noticed interesting thing with dropdown displayValue property. If for example I will pass displayValue property as undefined ( can happen in Javascript ) , this will break dropdown. This means no placeholder will be shown and ofcourse after selecting value , no value will be displayed.

I've investigated source code a bit and found some interesting thing. If displayValue is not a type of string ( undefined is definitely not a string ) , You expect that displayValue will be <TemplateRef> . But in our case as displayValue is undefined and this breaks component.
The question is , maybe it is worth to create some kind of "safeguard" in this particular case? I mean if displayValue will be undefined , then just assign it empty string instead to avoid this kind of behaviour ? Because I believe those kidn of "bugs" can bring a lot of pain when debugging.
Thank You!