Guard against empty values array

pull/10616/head
Alex P 2018-04-20 10:15:34 -07:00
parent 123a6d0455
commit 15c738e428
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,11 @@ export const dropdownPadding = 30
const valueLength = a => _.size(a.value)
export const calculateDropdownWidth = (values = []) => {
export const calculateDropdownWidth = values => {
if (!values || !values.length) {
return minDropdownWidth
}
const longest = _.maxBy(values, valueLength)
const longestValuePixels =