weaveworks / ui-components

A collection of UI components that are shared across Weaveworks projects
http://weaveworks-ui-components.s3-website-us-west-2.amazonaws.com/
Apache License 2.0
30 stars 26 forks source link

workaround for dropdown item label title `[object Object]` #469

Closed dimitropoulos closed 5 years ago

dimitropoulos commented 5 years ago

Screenshot_20190322_123747

The above UI bug can happen in a situation where the label passed in is an object since objects are truthy in javascript. Ideally, Flow should catch this kind of problem but since it doesn't (from what I can tell the type gets lost as it goes through the lodash/find on line 200), a type check here will work for now.

dimitropoulos commented 5 years ago

thanks @rndstr - I'll hopefully be setting up my environment for javascript dev soon enough but you saved me from having to do it now :)

fbarl commented 5 years ago

ping @dimitropoulos - anything still blocking you from merging this?

dimitropoulos commented 5 years ago

no - merging now.