mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00
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:
@ -41,7 +41,8 @@ export default function listItems(items) {
|
||||
(item.itemName ? 'item-' + item.itemName : ''),
|
||||
className,
|
||||
(active ? 'active' : '')
|
||||
])}>
|
||||
])}
|
||||
key={item.itemName}>
|
||||
{item}
|
||||
</li>,
|
||||
' '
|
||||
|
Reference in New Issue
Block a user