Key item lists to maintain identity across redraws

Fixes #667. This issue was due to the fact that Mithril would change the "Lock" badge into a "Sticky" badge, but the tooltip initialization would not be triggered because it was using the same element. By maintaining element identity, the "Lock" badge will remain untouched, and a new element for the "Sticky" badge will be inserted before it. See https://lhorie.github.io/mithril/mithril.html#dealing-with-focus for more information.
This commit is contained in:
Toby Zerner
2016-01-13 09:34:12 +10:30
parent df2a199b48
commit e5a7013c2c
2 changed files with 2 additions and 6 deletions

View File

@ -41,7 +41,8 @@ export default function listItems(items) {
(item.itemName ? 'item-' + item.itemName : ''),
className,
(active ? 'active' : '')
])}>
])}
key={item.itemName}>
{item}
</li>,
' '