mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-09 14:16:02 +08:00
fix(search-bar): Apparently we were not providing keys
This commit is contained in:
parent
f85f447141
commit
1b6525910c
2 changed files with 8 additions and 6 deletions
|
@ -90,7 +90,7 @@ class SearchBar extends React.Component
|
||||||
headerComponents={headerComponents}
|
headerComponents={headerComponents}
|
||||||
items={@state.suggestions}
|
items={@state.suggestions}
|
||||||
itemContent={itemContentFunc}
|
itemContent={itemContentFunc}
|
||||||
itemKey={ (item) -> item.id ? item.label }
|
itemKey={ (item) -> item.label || item.contact?.id || item.thread?.id}
|
||||||
onSelect={@_onSelectSuggestion}
|
onSelect={@_onSelectSuggestion}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -250,11 +250,13 @@ class Menu extends React.Component
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
@props.onSelect(item) if @props.onSelect
|
@props.onSelect(item) if @props.onSelect
|
||||||
|
|
||||||
<MenuItem onMouseDown={onMouseDown}
|
<MenuItem
|
||||||
key={@props.itemKey(item)}
|
onMouseDown={onMouseDown}
|
||||||
checked={@props.itemChecked?(item)}
|
key={@props.itemKey(item)}
|
||||||
content={content}
|
checked={@props.itemChecked?(item)}
|
||||||
selected={@state.selectedIndex is i} />
|
content={content}
|
||||||
|
selected={@state.selectedIndex is i}
|
||||||
|
/>
|
||||||
|
|
||||||
_onShiftSelectedIndex: (delta) =>
|
_onShiftSelectedIndex: (delta) =>
|
||||||
return if @props.items.length is 0
|
return if @props.items.length is 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue