1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Fix post header items sometimes getting out of order. closes flarum/core#975

Interesting bug. Turns out that the JSX for the post header item list was producing m('ul', null, [children]), as you would expect. But Mithril 0.1.x interprets the null as another child rather than an attributes splat. This results in an empty text node being added to the DOM, which mucks up Mithril's diffing algorithm when it tries to add/move the items that we provide in the children array. The workaround is to not use JSX so we can get rid of that null/empty text node. This behaviour has been fixed in Mithril 1.0 so we will be able to remove the workaround.
This commit is contained in:
Toby Zerner
2016-08-27 23:41:54 +09:30
4 changed files with 22 additions and 22 deletions

View File

@@ -21358,12 +21358,12 @@ System.register('flarum/helpers/listItems', ['flarum/components/Separator', 'fla
item.attrs.key = item.attrs.key || item.itemName;
}
return [isListItem ? item : m(
return isListItem ? item : m(
'li',
{ className: classList([item.itemName ? 'item-' + item.itemName : '', className, active ? 'active' : '']),
key: item.itemName },
item
)];
);
});
}