fix(search-bar): Apparently we were not providing keys

This commit is contained in:
Ben Gotow 2016-04-13 16:08:24 -07:00
parent f85f447141
commit 1b6525910c
2 changed files with 8 additions and 6 deletions

View file

@ -90,7 +90,7 @@ class SearchBar extends React.Component
headerComponents={headerComponents}
items={@state.suggestions}
itemContent={itemContentFunc}
itemKey={ (item) -> item.id ? item.label }
itemKey={ (item) -> item.label || item.contact?.id || item.thread?.id}
onSelect={@_onSelectSuggestion}
/>
</div>

View file

@ -250,11 +250,13 @@ class Menu extends React.Component
event.preventDefault()
@props.onSelect(item) if @props.onSelect
<MenuItem onMouseDown={onMouseDown}
key={@props.itemKey(item)}
checked={@props.itemChecked?(item)}
content={content}
selected={@state.selectedIndex is i} />
<MenuItem
onMouseDown={onMouseDown}
key={@props.itemKey(item)}
checked={@props.itemChecked?(item)}
content={content}
selected={@state.selectedIndex is i}
/>
_onShiftSelectedIndex: (delta) =>
return if @props.items.length is 0